0% found this document useful (0 votes)
3 views

Power Query Tutorial1

Uploaded by

lephiduong.zalo
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Power Query Tutorial1

Uploaded by

lephiduong.zalo
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Welcome

Instructions for screen readers: After you go through the tip sheets in this tutorial, you'll learn how to quickly master chart elements. The
instructions for each sheet start in cell A1, and each subsequent step is in cell A2, A3, and so on.
The instructions will indicate which cells to navigate to for use of a feature, or further reading.
To start, press CTRL+PAGE DOWN.

Get to know Power Query


Need to import or paste data into Excel? Would you also
like to clean it up, and keep it up-to-date? Power Query
is the answer, and this tutorial will show you the ropes.

Let's go >
Go back to top by pressing CTRL+HOME. To start the tour, press CTRL+PAGE DOWN.
Does this happen to you? You paste data into Excel, but then you have to clean it up. For example, in the data below
Does
First, this want
you might happen
to splitto
thisyou?
columnYou
into paste data into
two columns: Excel,
One for but then
first name, you
and one for have to clean it up. F
last name...
You might also want to remove "12:00 AM" from the last column, since it's repetitive and unnecessary.
the data below, there are a couple things you might want to do...
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.

First, you might want to split this column into two columns: One
for first name, and one for last name...

Product Sales rep Order date


Beer Anne Cho 1/15/18 12:00 AM
Plums Tim Anders 1/15/18 12:00 AM You might also want to remove "12:00 AM" from this co
Pears Jan Kotas 1/20/18 12:00 AM since it's repetitive and unnecessary.
Apples Sam Ioto 1/20/18 12:00 AM

Previous
Feedback
For example, in the data below, there are a couple things you might want to do...
you
e for have to clean it up. For example, in
last name...
and unnecessary.
.
et, press CTRL + PAGE UP.

remove "12:00 AM" from this column,


epetitive and unnecessary.

Next
You could clean up the data manually, but this can be time consuming...
You You could
could fix this clean upa the
by adding data manually,
new column but this
for the last names, canyou
and then be could
timecut consuming...
and paste the last names into
...You could also reformat the last column to exclude "12:00 AM," but that's a lot of work…
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.

You could fix this by adding a new column for the last names, and then you
could cut and paste the last names into that new column...

Product Sales rep Order date


Beer Anne Cho 1/15/18 12:00 AM
Plums Tim Anders 1/15/18 12:00 AM
...You could also reformat this column to exclude
Pears Jan Kotas 1/20/18 12:00 AM
"12:00 AM," but that's a lot of work...
Apples Sam Ioto 1/20/18 12:00 AM

Previous
Feedback
onsuming...
and paste the last names into that new column…

et, press CTRL + PAGE UP.

eformat this column to exclude


" but that's a lot of work...

Next
Forget manually cutting, pasting, and reformatting. A better way to clean up data is to use Power Query.
To Forget manually
continue with cutting,
this tutorial, pasting,
press CTRL + PAGEand reformatting.
DOWN. A better
To go to the previous sheet,way
presstoCTRL
clean up data
+ PAGE UP. is
Query.

Previous
Feedback
Power Query.
y toCTRL
ess clean up data
+ PAGE UP. is to use Power

Next
What is Power Query? It's a special editor that allows you to clean data so that it's easier to work with.
The original data can be found in cells B11 through D15.
What
Then is Power
we used Query?
Power Query It's the
to create a special
cleaned editor that found
up data table allows youH11
in cells to clean
throughdata
K15. so that it's easie
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.

This is the original data... ... then we used Power Query...

Product Sales rep Order date


Beer Anne Cho 1/15/18 12:00 AM
Plums Tim Anders 1/15/18 12:00 AM
Pears Jan Kotas 1/20/18 12:00 AM
Apples Sam Ioto 1/20/18 12:00 AM

Previous
Feedback
er to work with.

an data so that it's easier to work with.


, press CTRL + PAGE UP.

... and now it's cleaned up!

Column1 Column2 Column3 Column4

Next
Another great thing about Power Query: If you add new data that's "dirty," Power Query can clean that up too, with j
Another
Cells great
B7 through thingdata.
D12 contain about
TherePower Query:
are three columns:IfProduct,
you add new
Sales rep,data that'sdate.
and Order "dirty,"
Each Power Qu
column has
Cells G7 through J12 contain data. There are three columns: Product, First name, Last name, and Order date. Each
up too, with just a click of a button. Try it out below!
TRY THIS: If you see the Enable Content button at the top of Excel, select it (ALT+F, N). Then type your first and la
...Then on the Data tab, click Refresh All (ALT+A, R). You'll see that Power Query added the new row for Kiwis, and
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Product Sales rep Order date Column1 Column2
Bananas Anne Cho 1/15/18 12:00 AM
Plums Tim Anders 1/15/18 12:00 AM
Pears Jan Kotas 1/20/18 12:00 AM
Apples Sam Ioto 1/20/18 12:00 AM
Kiwis 5/24/24 12:00 AM

...Then on the Data tab, click Refresh All.


TRY THIS You'll see that Power Query added the new
If you see the Enable Content button at row for Kiwis, and it cleaned up the data b
the top of Excel, click it. Then type your splitting your first name into cell H12 and
first and last name into cell C12. your last name into cell I12.

Previous
Feedback
ry can clean that up too, with just a click of a button. Try it out below!
that'sdate.
Order "dirty,"
Each Power Query
column has can
various clean
values for that
each row.
t name, and Order date. Each column has various values for each row.
N). Then type your first and last name into cell C12.
ed the new row for Kiwis, and it cleaned up the data by splitting your first name into cell H12 and your last name into cell I12.
t, press CTRL + PAGE UP.
Column3 Column4

the Data tab, click Refresh All.


that Power Query added the new
wis, and it cleaned up the data by
our first name into cell H12 and
name into cell I12.

Next
d your last name into cell I12.
Why do they call it Power Query? Between the original data, and the clean data, there's a powerful query that links t
Why
Cells do they
B7 through D11call it Power
contain Query?
data. There Between
are three the original
columns: Product, data,
Sales rep, andand the
Order clean
date. Eachdata, there
column has
Cells G7 through J11 contain data. There are four columns: Product, First name, Last name, and Order date. Each c
query that links the two.
IMPORTANT DETAIL: Between the original data and the clean data, there's a query. The query contains all of the c
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.

Product Sales rep Order date Column1 Column2


Bananas Anne Cho 1/15/18 12:00 AM
Plums Tim Anders 1/15/18 12:00 AM
Pears Jan Kotas 1/20/18 12:00 AM
Apples Sam Ioto 1/20/18 12:00 AM

IMPORTANT DETAIL
Between the original data and the clean data, there's a query.
The query contains all of the cleaning steps, so you don't have
to redo them again if new data is added. All you have to do is
click Refresh, and Power Query cleans it up automatically.

Previous
Feedback
e's a powerful query that links the two.
dand the
Order clean
date. Eachdata,
column there's a powerful
has various values for each row.
t name, and Order date. Each column has various values for each row.
The query contains all of the cleaning steps, so you don't have to redo them again if new data is added. All you have to do is s
et, press CTRL + PAGE UP.

Column3 Column4

's a query.
don't have
e to do is
tically.

Next
ed. All you have to do is select Refresh (Alt+A, R), and Power Query cleans it up automatically.
There are three main steps to using Power Query: Get Data, Transform, and Load.
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
There are three main steps to using Power Query: Get Data, Transform, and Load.

Get Data Transform Load

Previous
Feedback
t, press CTRL + PAGE UP.
Transform, and Load.

oad

Next
The first step is Get Data. This is simply the process of getting your data into Power Query. We'll show you how this
To The first
continue step
with is Getpress
this tutorial, Data. This
CTRL is simply
+ PAGE DOWN. theToprocess
go to the of getting
previous your
sheet, data
press into
CTRL Power
+ PAGE UP.Qu
show you how this works in the videos coming up.

Get Data Transform Load

Previous
Feedback
uery. We'll show you how this works in the videos coming up.
t,our data
press CTRLinto Power
+ PAGE UP.Query. We'll

oad

Next
Transform is the second step, where you use Power Query to transform, or, clean the data. We'll walk you through t
Transform
EXCEL SPEAK: Whyis the second
the word, step, where
"Transform?" you
Well, you canuse Power
do more thanQuery tothe
just clean transform, or, add
data. You can clean the
or remov
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
walk you through this in the upcoming videos as well.

Get Data Transform Load

EXCEL SPEAK
Why the word, "Transform?" Well, you can do
the data. You can add or remove columns, filte
calculations, and a lot more.

Previous
Feedback
data. We'll walk you through this in the upcoming videos as well.
ransform, or, add
e data. You can clean the data.
or remove We'llfilter, add custom calculations, and a lot more.
columns,
t, press CTRL + PAGE UP.

oad

EAK
, "Transform?" Well, you can do more than just clean
can add or remove columns, filter, add custom
nd a lot more.

Next
And finally, Loading is the last step. This is the act of returning the cleaned-up, transformed data back into Excel.
To And finally,
continue Loading
with this is the
tutorial, press last
CTRL step.DOWN.
+ PAGE This isTothe act
go to theof returning
previous sheet,the cleaned-up,
press CTRL + PAGEtransfo
UP.
back into Excel.

Get Data Transform Load

Previous
Feedback
med data back into Excel.
t,the cleaned-up,
press CTRL + PAGEtransformed
UP. data

oad

Next
And keep in mind: Power Query isn't just for cleaning up pasted data. You can import and transform data from other
And
Cells keep in
F9 through I14mind: Power
contain data. Query
There isn't
are four just for
columns: cleaning
Year, up pasted
Champions, data.
Runners-up, You
Third canEach
place. import a
column
CHECK THIS OUT: In this example we used Power Query to get data from Wikipedia's FIFA World Cup page. You
from other sources, like a file, a database, or even a web page.
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.

Column1
Column2 Column3 Column4

Previous
Feedback
d transform data from other sources, like a file, a database, or even a web page.
data. You
p, Third canEach
place. import and
column hastransform data
various values for each row.
FIFA World Cup page. You can imagine other useful sources you might pull data from.
press CTRL + PAGE UP.

CHECK THIS OUT


In this example we used
Power Query to get data
from Wikipedia's FIFA
World Cup page. You can
imagine other useful
sources you might pull
data from.

Next
Before we show you how to use Power Query, we should warn you that its window, called the Power Query Editor, i
Before
GOOD we show
TO KNOW: youuse
You can't how to use
the Excel Power
window while Query,
the Powerit's worth
Query noting
Editor is open.that its window,
However, calle
once you're do
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Query Editor, is large and may cover Excel. This is expected.

Previous
Feedback
led the Power Query Editor, is large and may cover Excel. This is expected.
g that
pen. its window,
However, called
once you're donethe Power the data, you can close the editor. At that point, you'll able to work in the Excel wi
transforming
t, press CTRL + PAGE UP.

GOOD TO KNOW
You can't use the Excel window
while the Power Query Editor is
open. However, once you're done
transforming the data, you can
close the editor. At that point,
you'll able to work in the Excel
window again.

Next
ll able to work in the Excel window again.
In fact, if you have two monitors, we recommend moving the Power Query Editor window to the second monitor so t
Two Inmonitors
fact, ifside
youby have two
side with monitors,
Excel weand
opened on one recommend
Power Querymoving theother.
editor on the Power Query Editor win
If you have two monitors, put the Excel window in one…
second monitor so that you can view Excel at the same time for reference.
... and put the Power Query Editor in the other.
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.

If you have two monitors, put the Excel ... and put the Power Query Editor
window in one... in the other.

Previous
Feedback
ow to the second monitor so that you can view Excel at the same time for reference.
Power Query Editor window to the
eference.
t, press CTRL + PAGE UP.

the Power Query Editor


in the other.

Next
Start the videos
Start the videos
1. Take a look at the sheets at the bottom of this workbook. You'll see sheets for Import data from web, Categories,
2. Where are the videos? They'll appear in a web browser after you click the link in step 4.
3. Keep in mind, there are several videos, so make sure to bookmark the page. That way you can return to them in c
1 the
4. Watch TakePower
a look at the sheets
Query videos. 2 Where are the videos? 3 Keep in mind, there are
at the bottom of this They'll appear in a web
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous several videos,
sheet, presssoCTRL
make + PAGE UP.
workbook. You'll see browser after you click sure to bookmark the page.
sheets for Import data the link in step 4. That way you can return to
from web, Categories, them in case you need to
and Sales Data ... You'll take a break.
work with these sheets
while you watch the
videos.

Previous
Feedback
t data from web, Categories, and Sales Data ... You'll work with these sheets while you watch the videos.

ay you can return to them in case you need to take a break.


mind, there are 4 Watch the Power
ideos, so make
t, press CTRL + PAGE UP. Query videos.
ookmark the page.
you can return to
case you need to
eak.

Next
Copy this URL:
https://en.wikipedia.org/wiki/FIFA_World_Cup
Product Name Category
Apples Produce
Beer Beverages
Coffee Beverages
Green Tea Beverages
Pears Produce
Plums Produce
txt_ProdNam txt_SalesRep dt_OrderDate dbl_Sales
Beer Anne Hellung-Larsen 1/15/2018 0:00 14,000.36
Plums Anne Hellung-Larsen 1/15/2018 0:00 1,050.42
Total Sales Rep 15,050.78
Pears Jan Kotas 1/20/2018 0:00 3,000.51
Apples Jan Kotas 2/20/2018 0:00 5,300.04
Plums Jan Kotas 2/20/2018 0:00 350.13
Total Sales Rep 8,650.68
Coffee Mariya Sergienko 2/27/2018 0:00 9,200.97
Total Sales Rep 9,200.97
Green Tea Anne Hellung-Larsen 3/10/2018 0:00 13,800.89
Total Sales Rep 13,800.89
Coffee Mariya Sergienko 3/24/2018 0:00 5,980.40
Total Sales Rep 5,980.40
Beer Nancy Freehafer 4/5/2018 0:00 12,180.68
Total Sales Rep 12,180.68
Beer Michael Neipper 4/8/2018 0:00 42,000.42
Total Sales Rep 42,000.42
Apples Mariya Sergienko 5/24/2018 0:00 2,000.39
Plums Nancy Freehafer 5/24/2018 0:00 52.50
Coffee Nancy Freehafer 6/7/2018 0:00 2,300.20
Total Sales Rep 4,353.09
Apples Andrew Cencini 6/23/2018 0:00 15,900.61
Pears Andrew Cencini 6/23/2018 0:00 9,000.24
Total Sales Rep 24,900.85

You might also like