04 Power Query Tutorial
04 Power Query Tutorial
Participant Kit
After connecting with your data and selecting the Edit option, you will be presented with the query
editor. This is where any data transformation steps will be created or edited. There are 6 main area in
the editor to become familiar with.
1. The Ribbon – The user interface for the editor is quite similar to Excel and uses a visual ribbon style
command center. It organizes data transformation commands and other power query options into 5
main tabs.
2. Query List – This area lists all the queries in the current workbook. You can navigate to any query
from this area to begin editing it.
3. Data Preview – This area is where you will see a preview of the data with all the transformation
steps currently applied. You can also access a lot of the transformation commands here either from
the filter icons in the column headings or with a right click on the column heading.
4. Formula Bar – This is where you can see and edit the M code of the current transformation step.
Each transformation you make on your data is recorded and appears as a step in the applied steps
area.
5. Properties – This is where you can name your query. When you close and load the query to an Excel
table, power query will create a table with the same name as its source query if the table name isn’t
already taken. The query name is also how the M code will reference this query if we need to query
it in another query.
6. Applied Steps – This area is a chronological list of all the transformation steps that have been applied
to the data. You can move through the steps here and view the changes in the data preview area.
You can also delete, modify or reorder any steps in the query here.
The Query List has other abilities other than just listing out all the current workbook’s queries.
PBI-3000 Microsoft Power Query
Participant Kit
One of the primary functions of the query list is navigation. There’s no need to exit the query editor to
switch which query you’re working on. You can left click on any query to switch. The query you’re
currently on will be highlighted in a light green colour.
When you do eventually exit the editor with the close and load button, changes in all the queries you
edited will be saved.
You can hide the query list to create more room for the data preview. Left click on the small arrow in
the upper right corner to toggle the list between hidden and visible.
If you right click on any query in the list, there are a variety of options available.
• Copy and Paste – Copy and paste a query to make another copy of it.
• Delete – Delete the query. If you accidentally delete a query, there’s no undo button, but you can
exit the query editor without saving via close and load to restore your query.
PBI-3000 Microsoft Power Query
Participant Kit
• Rename – Rename your query. This is the same as renaming it from the properties section on the
left hand side of the editor.
• Duplicate – Make another copy of the query. This is the same as copy and paste but turns the
process into one step.
• Move To Group – Place your queries into a folder like structure to keep them organised when the
list gets large.
• Move Up and Move Down – Rearrange the order your queries appear in the list or within the folder
groups to add to your organisational efforts. This can also be done by dragging and dropping the
query to a new location.
• Create Function – Turn your query into a query function. They allow you to pass a parameter to the
query and return results based on the parameter passed.
• Convert To Parameter – Allows you to convert parameters to queries or queries to parameters.
• Advanced Editor – Open the advanced editor to edit the M code for the query.
• Properties – Allows you to change the query name, add a description text and enable Fast Data
Load option for the query.
If you right click any empty area in the query list, you can create a new query.
The main job of the data preview area is to apply transformation steps to your data and show a preview
of these steps you’re applying.
PBI-3000 Microsoft Power Query
Participant Kit
In the data preview area, you can select columns with a few different methods. A column will be
highlighted in a light green colour when it’s selected.
You can then apply any relevant data transformation steps on selected columns from the ribbon or
certain steps can be accessed with a right click on the column heading. Commands that are not available
to your selected column or columns will appear grayed out in the ribbon.
Each column has a data type icon on the left hand of the column heading. You can left click on it to
change the data type of the column.
You can choose from decimal numbers, currency, whole numbers, percentages, date and time, dates,
times, timezone, duration, text, Boolean, and binary.
Using the Locale option allows you to set the data type format using the convention from different
locations. For example, if you wanted to display the date in the American m/d/yyyy format instead of
the usual dd/mm/yyyy then you could select United States as the locale.
PBI-3000 Microsoft Power Query
Participant Kit
There’s a small table icon in the top left hand corner of the data preview, you can right click or left
click this to access various actions that affect the whole table.
Renaming any column heading is really easy. Double left click on any column heading then type your
new name and press Enter when you’re done.
PBI-3000 Microsoft Power Query
Participant Kit
You can change around the order of any of the columns with a left click and drag action. The green
border between two columns will become the new location of the dragged column when you release the
left click.
Each column also has a filter toggle on right hand side. Left click on this to sort and filter your data. This
filter menu is very similar to the filters found in a regular spreadsheet and will work the same way.
The list of items shown is based on a sample of the data so may not contain all available items in the
data. You can load more by clicking on the Load more text in blue.
PBI-3000 Microsoft Power Query
Participant Kit
Many transformations found in the ribbon menu are also accessible from the data preview area using a
right click on the column heading. Some of the action you select from this right click menu will replace
the current column. If you want to create a new column based, use a command from the Add Column
tab instead.
Any transformation you make to your data will appear as a step in the Applied Steps area. It also allows
you to navigate through your query. Left click on any step and the data preview will update to show all
transformations up to and including that step.
PBI-3000 Microsoft Power Query
Participant Kit
You can insert new steps into the query at any point by selecting the previous step and then creating the
transformation in the data preview. Power Query will then ask if you want to insert this new step. Careful
though, as this may break the following steps that refer to something you changed.
You can delete any steps that were applied using the X on the left hand side of the step name in the
Applied Steps area. Caution is needed though, as if any of the following steps depend on the step you’re
trying delete, you will break your query. This is where Delete Until End from the right click menu can be
handy.
A lot of transformation steps available in power query will have various user input parameters and other
setting associated with them. If you apply a filter on the product column to show all items not starting
with Pen, you might later decide you need to change this filter step to show all items not equal to Pen.
You can make these edits from the Applied Step area.
Some of the steps will have a small gear icon on the right hand side. This allows you to edit the inputs
and settings of that step.
You can rearrange the order the steps are performed in your query. Just left click on any step and drag
it to a new location. A green line between steps will indicate the new location. This is another one you’ll
need to be careful with as a lot of steps will depend on previous steps, and changing ordering can create
errors because of this.
PBI-3000 Microsoft Power Query
Participant Kit
• Edit Settings – This allows you to edit the settings of the step similar to using the gear icon on the
right hand side of the step.
• Rename – This allows you to rename the steps label. Instead of the displaying the generic name like
“Filtered Rows“, you could have this display something like “Filtered Product Rows on Pens” so you
can easily identify what the step is doing.
• Delete – This deletes the current step similar to the X on the left hand side of the step.
• Delete Until End – This allows you to delete the current step plus all steps up until the end. Since
steps can depend on previous steps, deleting all steps after a step is a good way to avoid any errors.
• Insert Step After – This allows you to insert a new step after the current step.
• Move Up and Move Down – This allows you to rearrange the query steps similar to the dragging and
dropping method.
• Extract Previous – This can be a really useful option. It allows you to create a new copy of the query
up to the selected step.
When you click on different steps of the transformation process in the Applied Steps area, the formula
bar updates to show the M code that was created for that step. If the M code generated is longer than
the formula bar, you can expand the formula bar using the arrow toggle on the right hand side.
PBI-3000 Microsoft Power Query
Participant Kit
You can edit the M code for a step directly from the formula bar without the need to open the advanced
editor. In this example, we’ve changed our filter from “Pen” to “Chair” by typing in the formula bar and
then pressing Enter or using the check mark on the left to confirm the change. Press Esc or use the X on
the left to discard any changes.
The File tab contains various options for saving any changes made to your queries as well as power query
options and settings.
• Close & Load – This will save your queries and load your current query into an Excel table in the
workbook.
• Close & Load To – This will open the Import Data menu with various data loading options to choose
from.
• Discard & Close – This will discard any changes you made to the queries during your session in the
editor and close the editor.
Note, you will still need to save the workbook in the regular way to keep any changes to queries if you
close the workbook.
Close & Load and Close & Load To commands are also available from the Home tab.
When you use the Close & Load To option to exit the editor, this will open the Import Data menu.
You can choose to load the query to a table, pivot table, pivot chart or only create a connection for the
query. The connection only option will mean there is no data output to the workbook, but you can still
use this query in other queries. This is a good option if the query is an intermediate step in a data
transformation process.
You’ll also be able to select the location to load to in your workbook if you selected either a table, pivot
table or pivot chart in the previous section. You can choose a cell in an existing worksheet or load it to a
new sheet that Excel will create for you automatically.
The other option you get is the Add this data to the Data Model. This will allow you to use the data output
in Power Pivot and use other Data Model functionality like building relationships between tables. The Data
Model Excel’s new efficient way of storing and using large amounts of data.
When you’re working outside of the power query editor, you can see and interact with all the queries in
the workbook through the Queries & Connections window. To open this, go to the Data tab in the regular
Excel ribbon, then press the Queries & Connections command button found in the Queries & Connections
section.
When opened it will be docked to the right hand side of the workbook. You can undock it by left clicking
on the title and dragging it. You can drag it to the left hand side and dock it there or leave it floating.
You can also resize the window by left clicking and dragging the edges.
PBI-3000 Microsoft Power Query
Participant Kit
This is very similar to the query list in the editor and you can perform a lot of the same actions with a
right click on any query.
One option worth noting that’s not in the query list right click menu, is the Load To option. This will allow
you to change the loading option for any query, so you can change any Connection only queries to load
to an Excel table in the workbook.
PBI-3000 Microsoft Power Query
Participant Kit
Another thing worth noting is when you hover over a query with the mouse cursor, Excel will generate a
Peek Data Preview. This will show you some basic information about the query.
• Data Preview – This is a live preview of the data similar to when first setting up a query.
• Columns – This will give you a list of all the columns contained in the final results of the query along
with a count of how many columns there are. Clicking on any of them will highlight the column in the
data preview.
• Last Refreshed – This will tell you when the data was last refreshed.
• Load Status – This displays whether the data is loaded to a table, pivot table, pivot chart or is a
connection only.
• Data Sources – This will show you the source of the data along with a count of the number of files if
you’re it’s a from folder query.
• View in Worksheet – Clicking on this will take you to the output table if the query is loaded to a table,
pivot table or pivot chart.
You can also access this Peek view by right clicking on the query and selecting Show the peek.
PBI-3000 Microsoft Power Query
Participant Kit
There are also some useful messages displayed in the Queries & Connections window for each query. It
will show you if the query is a connection only, if there were any errors when the query last ran, or how
many rows loaded.
The Home tab contains all the actions, transformations, and settings that will affect the whole table.
1. Close – You can access the Close & Load and Close & Load To options from here. These are also
available in the File tab menu.
PBI-3000 Microsoft Power Query
Participant Kit
2. Query – You can refresh the data preview for the current query or all query connections. You can also
open the properties settings and the advanced editor for the current query and there are options
under the Manage button to delete, duplicate or reference the current query.
3. Manage Columns – You can navigate to specific columns and choose to keep or remove columns.
4. Reduce Rows – You can manage the rows of data from this section. There are lots of options to either
keep certain rows or remove certain rows. Keep or remove the top N rows, the bottom N rows, a
particular range of rows, alternating rows, duplicate rows or rows with errors. One option only
available for removing rows is to remove blank rows.
5. Sort – You can sort any column in either ascending or descending order.
6. Transform – This section contains a mix of useful transformation options.
• Split Columns – This allows you to split the data in a column based on a delimiter or character
length.
• Group By – This allows you to group and summarize your data similar to a Group By in SQL.
• Data Type – This allows you to change the data type of any column.
• Use First Row as Headers – This allows you to promote the first row of data to column headings
or demote the column headings to a row of data.
• Replace Values – This allows you to find and replace any value from a column.
7. Combine – This sections contains all the commands for joining your query to with other queries. You
can merge, append queries or combine files when working with a from folder query.
8. Parameters – Power Query allows you to create parameters for your queries. For example when
setting up a from folder query, you may want the folder path to be a parameter as so you can easily
change the location. You can create and manage existing parameters from this section.
9. Data Sources – This section contains the data source settings including permissions management for
any data sources that require passwords to access.
10. New Query – You can create new queries from new data sources or previously used data sources
from this section.
The bulk of all transformations available in power query can be accessed through either the Transform
tab or the Add Column tab.
You might think there is a lot of duplication between these two tabs. For example, both tabs contain a
From Text section with a lot of the same commands. It’s not really the case, there is a subtle difference!
When you use a command from the Add Column tab that is found in both tabs, it will create a new column
with the transformed data and the original column will stay intact. Whereas using the equivalent
command from the Transform tab will change the original column and no new column is created.
Table – This section contains commands that will transform the entire table. You can group and aggregate
your query, promote rows to headers, demote headers to rows, transpose your data, reverse row order,
and count rows.
Any Column – This section contains commands that will work on any column of data regardless of data
type. You can change the data type, automatically detect and change the data type, rename the column
heading, find and replace values, fill values down (or up) a column to replace any blanks or nulls with
the value above it (or below it), pivot or unpivot columns, move columns to a new location or convert a
column to a list.
Text Column – This section contains commands for text data. You can split columns with a delimiter,
format the case, trim and clean, merge two or more columns together, extract text, and parse XML or
JSON objects.
Number Column – This section contains commands for numerical data. You can perform various
aggregations like sums and averages, perform standard algebra operations or trigonometry and round
numbers up or down.
Date & Time Column – This section contains commands for date and time data. You can extract
information from your dates, times and duration data.
Structured Column – This section contains commands for working with nested data structures such as
when your column contains tables.
The Add Column tab contains a lot of commands similar to the Transform tab, but the key difference is
they will create a new column with the transformation.
General – This section allows you to add new columns based on formulas or custom functions. You can
also add index columns or duplicate a column from here.
PBI-3000 Microsoft Power Query
Participant Kit
From Text – Very similar to the From Text section in the Transform tab, but these commands will create
a new column with the transformation.
From Number – Very similar to the From Number section in the Transform tab, but these commands will
create a new column with the transformation.
From Date & Time – Very similar to the From Date & Time section in the Transform tab, but these
commands will create a new column with the transformation.
The View tab is quite sparse in comparison to the other tabs. There are no transformation commands
to be found in it. Most Power Query users will rarely need to use this area, but there are still a few things
worth knowing about.
1. Layout – This section allows you to either show or hide the Query Setting pane (which contain the
properties and applied steps) and the Formula Bar.
2. Data Preview – This section allows you to show or hide whitespace characters or turn the font into a
monospace font in the data preview area. This is handy when dealing with data delimited by a certain
number of characters.
3. Columns – This allows you to go to and select a certain column in the data preview. This command
is also available in the Home tab.
4. Parameters – This allows you to enable parameterization in data sources and transformation steps.
5. Advanced – This will open the advanced query editor which shows the M code for the query. This is
also available from the Home tab.
6. Dependencies – This will open a diagram view of the query dependencies in the workbook.
In particular, the Query Dependencies view is a useful resource that allows you to see a visual
representation of the data transformation process flow.
Conclusions
Power Query can seem overwhelming at first to someone new to it all, but the UI is very well laid out
and easy to catch on to. While it might be new to a user, a lot of the concepts should be familiar to an
Excel user already.
Getting familiar with all the parts of the editor and the layout of the ribbon tabs is an essential first step
in exploring Power Query and incorporating it into your everyday work.
While there is a lot to learn about Power Query, it is worth putting in the time to learn. There is massive
potential to save time in repetitive data cleaning and formatting tasks with it. It’s one of the most
powerful and useful tools that has been added to Excel since pivot tables. Want even more power query
goodness? Then check out these Amazing Power Query Tips to help you get the most out of it!
PBI-3000 Microsoft Power Query
Participant Kit
Sometimes when you are building a query with a lot of steps, you end up going down the wrong path. If
you’re able to pin point at which step your query started going wrong, then you can delete that step and
all steps after to start over (without fully starting over).
In the Applied Steps window pane, right click on the first step you want to delete and then select Delete
Until End from the menu.
This will delete that step and all query steps after that step.
A column in your query might contain table objects. If this is the case, the column’s row entries will
display the text Table and the data type icon.
You can either preview the table or navigate to it in the query depending on where you click in the cell.
PBI-3000 Microsoft Power Query
Participant Kit
If you click on the blank area of a cell containing a table object, then you will be shown a preview of the
table below your query.
When you hover the mouse cursor over the word Table in the cell, it will change to a pointing hand icon.
When you click on this part the query, it will add a navigation step to the query which navigates to that
particular table.
Editing a query can be done a couple different ways from the Queries & Connections window pane.
• You can right click on the query then choose Edit from the menu.
• You can hover the cursor over the query until the peek window appears, then press the Edit button
from the peek window.
The quickest way is to double left click on the query. This will open the query editor on the selected
query.
You can add an index column to any query through the power query editor, but it is also possible to add
an index row to a query that’s been loaded to a table in a special way. Select a cell in the table output
and go to the Data tab and press the Properties button.
Note that the Properties option found in the right click menu of the Queries & Connection pane will open
the Query Properties window and not the External Data Properties window that is needed for this tip.
PBI-3000 Microsoft Power Query
Participant Kit
This will open the External Data Properties menu and you can check the Include row numbers option and
press the Ok button.
Now the next time you refresh the query loaded to your table, a new column called _RowNum will appear
as the left most column and will contain an index for the row number starting at 0.
When you press the Close & Load button for a query the first time, power query will load the data into
an Excel table in the workbook and doesn’t add the data into the data model. This is the default load
settings in power query.
If you want load the data as a connection only or need to load it into the data model to use with power
pivot later on, then you need to select Close & Load To instead and select these options each time you
create a new query.
PBI-3000 Microsoft Power Query
Participant Kit
If you find most of the queries you end up creating need to be a connection only or need to load into the
data model, then you can change the default load settings. Go to the Data tab then choose Get Data
then open the Query Options.
In the Global Data Load settings, choose the Specify custom default load settings option and then select
or deselect the desired options.
• Unchecking both the Load to worksheet box and the Load to Data Model box will result in your queries
loading as connection only and will not load the data into the data model.
• Checking the Load to worksheet box and unchecking the Load to Data Model box will load queries
into an Excel table and not load data to the data model. Note this is the same as when Use standard
load settings is selected.
• Unchecking the Load to worksheet box and checking the Load to Data Model box will result in your
queries loading as connection only and will load the data into the data model.
• Checking both the Load to worksheet box and the Load to Data Model box will load queries into an
Excel table and will load the data into the data model.
It can sometimes be hard to tell if each item in a column of data has the same character length. Not all
characters have the same width when using the default query editor font. This can make it hard to tell if
you will be able to split a field by character length consistently for the entire column.
You can select a column by clicking on its column heading. The column will turn to a light green colour
when selected and you will then be able to perform various transformations on it by either right clicking
on the column heading or using any of the transformation commands from the ribbon.
Once a column is selected, you can navigate to other columns using the left or right arrow keys. In fact,
you don’t even need to select a column first, just press the right arrow key and the first column will be
selected.
The same trick can be done with rows of data. Once a row is selected from clicking on the row heading
you can navigate to other rows using the up or down arrow keys. Again, no need to select a row first,
just press the down arrow key and the first row will be selected.
If you select a single cell in a column, you can use the Ctrl + Space keyboard shortcut to select the entire
column. You can also use the Ctrl + A keyboard shortcut to select the entire table. Just like in a regular
Excel worksheet!
You can do a lot with power query just from the UI without ever touching any of the M code that is
created behind the scenes. If you do start exploring the M code using the advanced editor (View tab then
Advanced Editor), then you’re likely going to want to add comments to your code.
You can create a single line comment by starting the line with a // double forward slash.
You can create multiple line comments by starting the first line of the comment with a /* forward slash
followed by an astrix, then ending the last line of the comment with a */ astrix followed by a forward
slash.
Unfortunately, any comments you add into the advanced editor will only be visible in the advanced editor.
You won’t be able to see them in the formula bar when navigating through the applied steps of your
query.
It is possible to add comments without opening the advanced editor. Select the step from the applied
steps to which you want to add a comment. Add your comment to the end of the step using either
comment type and press the Enter button.
PBI-3000 Microsoft Power Query
Participant Kit
The comment will appear visible in the formula bar until you navigate away to a different step or different
query. When you come back it won’t be visible in the formula bar any more, but it will still be there in
the M code and visible in the advanced editor.
I already said comments are only visible from the advanced editor, but there is a hack to get them to
show up in the formula bar.
Write your comment inside a formula instead of at the end of the step. You’ll need to use the opening /*
and closing */ comment characters as the comment will need to be closed so the rest of the formula is
not considered as part of the comment.
This will remain visible in the formula bar when navigating through the applied steps of your query.
You can add comments to any of the query steps listed in the applied steps window pane using the
query’s properties window. Right click on the query and select Properties from the menu.
You’ll be able to add a description to the step. This description will appear as a single line comment above
the M code for the step in the advanced editor.
You can also change the name of the step from this window. This will change the references for the step
in the advanced editor as well.
Creating a sequential list object in power query is easy when you know how. Add a custom column with
the following formula for a list starting at 5 and ending at 10.
={5..10}
This will even work by referencing columns instead of static hardcoded numbers. Use a formula similar
to the following where [Start] and [End] are two whole number columns in your query.
={[Start]..[End]}
If either the Start or End column is a decimal number, the expression will result in a error.
If the Start number is greater than the End number, the expression will result in an empty list.
Power query is case sensitive. This can cause errors in your data analysis down the road if you’re not
careful.
If you filter out the item Keyboard from your data and later it shows up as keyboard in the source data,
then your query won’t filter out the lower case version.
PBI-3000 Microsoft Power Query
Participant Kit
This can be avoided by transforming a column to upper case before applying any filters.
We can also retain the original case in our data by using the UPPERCASE transformation found in the Add
Column tab. This will create a new column with the upper case values while keeping the original column
intact.
Now we can apply any filter on the uppercase version of the column and then delete the column after.
This allows us to apply a case insensitive filter without altering the case in our data.
You’re probably going to be renaming a lot of columns during your power query career so you’re going
to want to learn the quickest way to do it. A double left click on the column heading will allow you to
quickly change a column’s name.
You can rename a column using a keyboard shortcut. This one is a bit slower, but worth knowing for
those that prefer the keyboard to the mouse. With the column selected, press F2 on the keyboard and
you can rename the column heading.
This feature can be a life saver when your workbook starts to get overloaded with queries. It can be easy
to forget what query is using what data source and which queries depend on each other.
Go to the View tab and press the Query Dependencies command to open the query dependencies viewer.
This will give you a visual representation of all the queries in the workbook along with their precedents
and dependents.
PBI-3000 Microsoft Power Query
Participant Kit
1. You’ll be able to see your data sources. These are the smaller boxes in the window and will have a
larger icon indicating the type of source data.
2. Left click on any item and it will turn a light green along with all its dependents and precedents.
3. Right click on any item and a menu will appear with the option to center the view on that item or
center the view on all the precedent and dependent items.
4. Left click and drag any empty area to move the view around.
5. You can change the layout to show dependencies from top to bottom, bottom to top, left to right or
right to left.
6. You can zoom in or out on the view manually using the zoom bar. Another way you can zoom in on
the view is using the mouse scroll wheel if yours is equipped with one. Another option is to double
left click on any empty area to zoom in.
7. You can fully zoom out on the view using the zoom out button on the lower right.
Drill down to any single item in your query. Right click on the cell and choose Drill Down.
Depending on your data, this could be a single value, list or a table. This can be useful for creating a
single value from your data which you can reference in a custom column calculation.
Faster is always better, right? If your queries are slow, you can enable the fast data load option to speed
them up. Go to the Data tab and press the Get Data button, then open the Query Options.
Go to the Global Data Load settings and check the Fast Data Load box. Your queries will take less time
to load, but Excel may become unresponsive during the loading.
When you import data into Excel with power query, Excel will guess what data type each column is based
on the first few hundred rows. Power query will then automatically create query steps to promote the
first row to column headings (for CSV files) and change data types.
If you prefer to control the data type selection and not have excel automatically create this steps for you,
then you can disable this option.
PBI-3000 Microsoft Power Query
Participant Kit
To open the query options, go to the Data tab then Get Data then choose the Query Options.
Go to the Current Workbook Data Load settings and check the box to Automatically detect column types
and headers for unstructured sources.
Next time you create a query, you won’t see any steps other than the source step.
Power query’s M code language is a functional language. This means the M code is mostly built with
functions that do specific things based on their inputs. Writing M code in power query is like building with
Lego, there are many different types of Lego pieces and each piece is designed for a specific purpose.
M code comes with a large selections of functions to use. In fact you can explore the entire library of
available functions from within the power query editor.
Create a new blank query, go to the Data tab and press the Get Data command then choose From Other
Sources then choose Blank Query. Now in the formula bar enter =#shared and press Enter.
PBI-3000 Microsoft Power Query
Participant Kit
Power query will then show all the items available to the workbook. This will include all the power query
functions!
PBI-3000 Microsoft Power Query
Participant Kit
If you click on any of the functions listed, you’ll be taken to a mini help guide for that function.
Maybe your query is getting too long, or maybe you want to use the first part of it as a source in other
queries. If this is the case, you can split up a query into two parts.
Right click on the step on which you want to divide the query then choose Extract Previous from the
menu. This will extract the steps before the selected step into a new query. You’ll then be prompted to
name the new query.
The remaining steps will then reference the new query as its source.
If you need to reuse a power query from a previous workbook, you can easily copy and paste it from the
old workbook to the new workbook.
PBI-3000 Microsoft Power Query
Participant Kit
In the Queries & Connections window of the old workbook, select the queries you want to copy then right
click and choose Copy from the menu. Now navigate to the new workbook and right click in the Queries
& Connections window and choose Paste from the menu.
This will copy all the selected queries along with all the queries they reference.
If any of the copied queries, or the queries they depend on, reference a table in the old workbook then
those queries will show a Download did not complete error message. You will need to copy over those
tables into the new workbook separately to fix this.
You can quickly rename any query from the query list pane on the left hand side of the query editor.
Double left click on the query which you want to rename, then type in the new name and press Enter to
confirm the change.
If you find the ribbon in the power query editor is getting in the way, you can hide. Double left click on
any of the ribbon tabs to hide the ribbon. Double left click on the tab again to show the ribbon.
Yep, this is the same trick from the regular workbook ribbon but it can also be used in the power query
editor!
This is another tip that can potentially speed up your power query queries.
When you load data into the data model from power query, Power BI will try to find and build relationships
between the new data and other tables in the data model. This extra processing step will slow down your
queries.
If you are always loading your data into the data model then you might want to turn this feature off to
save time. Go to the Data tab then press the Get Data button and open the Query Options.
In the Current Workbook Data Load settings, uncheck the Create relationships between tables when
adding to the Data Model for the first time option. This will prevent Power BI from creating the
relationships between tables in the data model.