0% found this document useful (0 votes)
2 views57 pages

Microsoft Excel Power Query

The document provides an overview of Microsoft Excel's Power Query, a self-service ETL tool available as an add-in for Excel 2010 and later. It outlines the agenda, system requirements, and demonstrates various functionalities such as data cleansing, extracting data from different sources, and appending or merging queries. Additionally, it includes contact information for the presenter, Didi Santeco.

Uploaded by

razaroyroy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views57 pages

Microsoft Excel Power Query

The document provides an overview of Microsoft Excel's Power Query, a self-service ETL tool available as an add-in for Excel 2010 and later. It outlines the agenda, system requirements, and demonstrates various functionalities such as data cleansing, extracting data from different sources, and appending or merging queries. Additionally, it includes contact information for the presenter, Didi Santeco.

Uploaded by

razaroyroy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Microsoft Excel

Power Query
Self‐Service Business Intelligence
Acknowledge:
Linda
• Oklahoma Office, Senior Manager
O’Neal

Rachel
• Oklahoma Office, Compliance Manager
Loudon

Scott • Oklahoma Office, Senior Manager in Tribal


Huebert

www.finley‐cook.com
Presented By:

Didi
Santeco

• Didi Santeco ‐ Hawaii Office


• Business Consultant
• Microsoft Dynamics NAV
• Microsoft Dynamics AX
• Jet Reports
Agenda:
• What is Power Query?
• Download & System Requirements
• Demonstration
Power Query:
• A Microsoft product
• An Excel add‐in
• Available for Excel 2010 and up
• A Self‐service ETL tool
Data Cleansing:

• 12/1/2015 • HAWAII
• 12/01/15 • HI
• Dec. 1, 2015 • Hi
• December 1, 2015 • Hawai’i
• 1 Dec 2015 • Hawaii
Download & System
Requirements:
• https://www.microsoft.com/en‐
us/download/details.aspx?id=39379
Add‐In:
• In Excel, navigate File >
Options
• Add‐Ins > Manage
• Select COM Add‐ins
• Click Go…
Add‐In:
• In COM Add‐Ins, check the box for Microsoft Power Query for
Excel.
• Click OK. POWER QUERY ribbon will appear in your Excel.
Get External Data:
• Data can be extracted from different types of sources.
Example 1:
• http://www.gapminder.org/data
• Search: population total
• Right‐click on Excel and Copy link address
Example 1:
• In Excel, in POWER QUERY ribbon, click From Web
• Paste the link address
• Click OK
Example 1:
• Select Data, click Edit to open the Query Editor
Example 1:
• Review columns, remove columns with null, they are not
usable. In one of the selected column headers, right‐click,
select Remove Columns.
Example 1:
• The column header is in row 1. Click Use First Row As Headers
to move data in row 1 to become column headers.
Example 1:
• Select all the year columns, in one of the selected column
headers, right‐click, select Replace Values. Find null and
replace with 0.
Example 1:
• With all the year columns selected, in one of the column
headers, right‐click, select Unpivot Columns.
Example 1:
• Modify the column headers now that the data has been
unpivoted. (Country, Year, and Population)

• Modify the Year data to number. In the Year column header,


right‐click, select Change Type and Whole Number.
Example 1:
• To remove rows with 0 population, click the drop‐down arrow
of Population header, uncheck 0 box, and click OK.
Example 1:
• Use Number Filters to keep only data from year 1980.
Example 1:
• Click Close & Load and select Close & Load. The query
provides the number of rows loaded.

• Click File > Save to save the


query.
• To make further modifications
to the query, right‐click on the
query and select Edit. It will
open the Query Editor.
Example 2:
• Use Append to stack data from multiple files, different file
types ( .xlsx, .txt, and .csv)
• In Excel, in POWER QUERY ribbon, click From File, select From
Excel.

• Navigate to the file folder, select the file, click OK.


Example 2:
• Navigator page is open. Select Sheet1, click Edit to open
Query Editor.
Example 2:
• Review the data, the column headers, rename the query to
Oahu Sale.
Example 2:
• Click Close & Load and select Close & Load. The query
provides the number of rows loaded.

• Repeat the steps to extract the other Excel file for Hawaii
Island Sales.
Example 2:
• In POWER QUERY ribbon, click From File, select From CSV.

• Navigate to the file folder, select the .csv file, click OK.
• Note that the query editor will open a .csv or .txt file right
away without the Navigator page, and the Query name is
defaulted to the original file name.
Example 2:
• Review the data, the column headers, and the query name.
Make adjustments as needed.
• Click Close & Load and select Close & Load.
Example 2:
• In POWER QUERY ribbon, click From File, select From Text.

• Navigate to the file folder, select the .txt file, click OK.
• Note that the query editor will open a .csv or .txt file right
away without the Navigator page, and the Query name is
defaulted to the original file name.
Example 2:
• Review the data, the column headers, and the query name.
Make adjustments as needed.
• Click Close & Load and select Close & Load.
Example 2:
• Right‐click on Oahu Sales and select Append.

• The primary table has already been defaulted to Oahu Sales.


Select Hawaii Island Sales as the table to append with the
primary table. Click OK.
Example 2:
• The two tables have been appended. Rename the query to
Final Sales.
Example 2:
• Click Close & Load and select Close & Load.
• Note that the number of rows of Final Sales is equal to the
Oahu Sales rows plus the Hawaii Island Sales rows.
Example 2:
• Right‐click on Final Sales and select Edit.
• In the Query Editor, click Append Queries.

• Select Maui Sales. Click OK.


Example 2:
• In the Query Editor, again click Append Queries.

• Select Kauai Sales. Click OK.


Example 2:
• Click Close & Load and select Close & Load.
• Note that the number of rows of Final Sales is now equal to
the all table rows combined.

• Click File > Save to save the query.


Example 3:
• Use Merge to combine data of two queries using a common
column value. This is as if you use VLOOKUP or HLOOKUP in
Excel but in a much more efficient and powerful way.
• Scenario: The sales report is an Excel file and the product file
is a Text file. The goal is to use add the Product and Company
information to the sales report. Product ID is the common
field except that in the sales file, the ID has additional ‐XX.
Example 3:
• In Excel, in POWER QUERY ribbon, click From File, select From
Excel.

• Navigate to the file folder, select the file, click OK.


Example 3:
• Navigator page is open. Select fTransaction1, click Edit to
open Query Editor.
Example 3:
• Review the data and the column headers.
• The Invoice Number column is not needed. Right‐click in the
column header and select Remove.
Example 3:
• Select the Product‐ID column header. Click Split Column and
select By Delimiter.

• Select ‐‐Custom‐‐ and enter a dash (‐).


• For Split option, select At the right‐most delimiter. Click OK.
Example 3:
• Review the Product‐ID.1 and Product‐ID.2 columns.

• Rename the Product‐ID.1 column header to Product‐ID.


• Right‐click in the Product‐ID.2 column header and select
Remove.
Example 3:
• Rename the query to Transaction Summary.

• Click Close & Load and select Close & Load.


Example 3:
• In POWER QUERY ribbon, click From File, select From Text.

• Navigate to the file folder, select the file, click OK.


Example 3:
• Review the data.
• The column headers are incorrect.
• Click Use First Row As Headers.
Example 3:
• Rename the query to Product List.

• Click Close & Load and select Close & Load.


Example 3:
• In the POWER QUERY ribbon, select the Transaction Summary
query, and click Merge.

• Transaction Summary is defaulted


in the top part of the Merge page.
Example 3:
• Select Product List. Select the Product‐ID column of each
table.
• Join Kind : Left Outer. Click OK.
Example 3:
• NewColumn column appears in the merged query.

• Rename the query to Final Transaction Report.


• Click on the split arrows of the NewColumn column header
and select Product and Company. Click OK.
Example 3:
• The two columns now appear. Rename the column headers to
Product and Company.

• Click Close & Load and select Close & Load.


Example 4:
• Rather than using Append, when you have files in the same
file format, extract data using From File > From Folder.
• In Excel, in POWER QUERY ribbon, click From File, select From
Folder.
Example 4:
• In the Folder page, enter the Folder Path, or click Browse and
locate the folder. Click OK.

• The Query Editor appears.


Example 4:
• Right‐click the Content column header and select Remove
Other Columns.

• Click the two‐arrow down next to the Content column header.

• The query is generated with the data from all the files in the
file folder. Rename the query if needed.
Example 4:
• Click Close & Load and select Close & Load.
Extract ‐> Transform ‐> Load (ETL)
Didi Santeco, Business Consultant
Telephone: 405‐395‐5150
Email: dsanteco@finley‐cook.com

You might also like