Power Query – The Heavyweight Champ of Power BI

Part 2 of a 5 part series

What is Power Query?

Power Query is a self-service data extraction tool that is a free add-in for Excel 2010 or higher. It allows users that are already comfortable with Excel a smaller learning curve to start enjoying Power Query. Power Query has a vast array of options that it can use as data sources. The types of sources that can be used are referenced in the screen shot.

clip_image002

Extracting a Source Data

One of the key tenets of Self-Service BI is that business users should be able to get the data they need to gain insights into their businesses in a timely manner. With Power Query, business users who use Excel can immediately begin extracting, transforming, and combining disparate sets of source data into meaningful information and knowledge to help them gain important insights about their businesses. To connect to a SQL data source follow this steps:

1. Click on the Power Query in Excel and then on the “From Database” button and select From SQL Server Database.

clip_image004

2. Supply SQL Server and database connection and then select the table(s) would want to work with from the Navigator pane.

clip_image006

3. Select Patron database and then “Edit” button.

clip_image008

Shaping your Data

Loading source data is only part of the puzzle, because in most cases your source data needs to be transformed or shaped differently to make it consumable. Typical transformation tasks include but are not limited to formatting record keys from different data sources into a single format; splitting data that is combined in a single column into multiple columns; and decoding cryptic column names using dictionary files to give the column values meaning to business users.

4. Transform/cleanse data by clicking replace values and filling in find and replace data.

clip_image010

5. Click on Split Column and select Custom delimiter from drop down and “-” to split the Zip column.

clip_image012

6. Replace Values to clean up values in a selected column

a. In the Query Editor ribbon, click Replace Values or right-click the column and click Replace Values to replace data.

clip_image013

7. Naming the query

a. In the Query Settings pane, in the Name text box, enter your name to define the query. This is also where you can modified the Applied Steps to the original data.

clip_image015

8. After you have cleansed, load the query to a worksheet

a. In the Query Editor ribbon, in the Query group, click Apply & Close.

clip_image017

Power Query for Excel almost effortlessly handles most data transformation tasks and quickly makes your data consumable. What’s especially powerful is the way that Power Query implements its data transformation functionality. For every change you make to a dataset, from simple tasks such as renaming columns or replacing values in strings, to traditionally more complex tasks such as splitting a single column into multiple columns or un-pivoting a large number of columns with cryptic names so they can be decoded, a macro is automatically created and executed to implement the change. If you make a mistake and want to undo a change, you simply delete the macro from the query, and the change will be undone.

Conclusion

Power Query is an excellent tool in Microsoft’s Power BI Suite and the heavyweight champ when extracting and shaping the data that business users need in a timely manner for additional analysis and visualization.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s