What is Power Query and How to use Power Query in Excel
How to Connect, Transform, Combine and Load data using this powerful Excel Feature
Part 1 of 2
#Excel #PowerQuery #dataanalytics
https://www.selectdistinct.co.uk/2023/03/13/how-to-use-power-query/
2. Whilst Power BI is known for its advanced data modelling and ability to
transform data,
You may not know that many of these functions are available in Excel.
These Blogs aim to give you the knowledge or skills to use these, namely
Power Query and Power Pivots.
This is Part 1 – How to use Power Query
3. How to use Power Query
What is Power Query?
Power Query is a versatile business intelligence tool that is available in Excel,
enabling you to import data from various sources and perform data cleaning,
transformation, and reshaping.
One of its most significant advantages is that you can set up a query once and reuse it
with a simple refresh, which can import and clean millions of rows into the data
model for analysis.
4. How to use Power Query
What is Power Query?
Power Query's user interface is well-designed, making it easy to learn, even for those
without prior experience using formulas or VBA.
The best part is that you don't need to learn any code to use it.
The Power Query Editor records all your transformations step by step and converts
them into the M code for you, which is similar to how the Macro recorder works with
VBA. We aim to cover off the basics in this blog to get you started.
5. Where to find Power Query
Power Query now known as Excel Get & Transform,
it consists of 4 stages. Connect, Transform, Combine and Load. In Excel 2010 and
2013 it is available as an add-in, in 2016 onwards it appears in the data tab as shown
below.
6. Connect
Simply Press the Get Data drop down and see what you can connect data to.
Sources include external files, databases or sources such as salesforce, adjacent
buttons also allow you can also add data from files or from the current workbook
with From Table/Range button.
Once set the data can be refreshed when required.
7. Transform
The real power of Power Query is the transform area which is found in the Power Query editor.
This can be found under the Get Data button by pressing Launch Power Query Editor or when you add
data to Power Query. The editor can be seen in the screen shot below, from here you can transform
the data to fit your requirements.
8. Transform
There are multiple transforms available each of these steps is recorded and repeatable.
The transforms include basic changes such removing or renaming columns, choosing data types or
more complex such as pivot and unpivot data.
The steps you undertake are found in the Applied Steps section each of these are recorded and can be
reviewed. The recorded steps are also captured within the Power Query M-Language, which you
review, modify or add to steps in the advanced editor.
9. Combine
You can combine multiple queries in your workbook, the main methods are to Append or Merge the
data. Append is similar to union all, merge is similar to a join. For example you can also use these to
merge multiple files in a folder.
Load
The main ways to load the data into your workbook are below:
1.From Power Query Editor you can Close & Load or Close & Load To
2.From the Excel Work Books Queries pane (Select Queries & Connections), right click a query and
select Load To.
This allows the data to be loaded to a tab or data model.
10. You have seen that Power Query brings the power of being able to
Connect, Transform, Combine and Load your data
In Part 2 we will show you how to use Power Pivot
Hope you find this useful
11. For more Tips, Tricks and
Timesavers, visit our website
Business Analytics Blog – Select Distinct
Credit: simon.harrison@selectdistinct.co.uk