-->
With Power Query in Power BI, you can connect to many different data sources, transform the data into the shape you want, and quickly be ready to create reports and insights. When using Power BI Desktop, Power Query functionality is provided in Power Query Editor.
Let's get acquainted with Power Query Editor.
If you're not signed up for Power BI, you can sign up for a free trial before you begin. Also, you can download Power BI Desktop for free.
To use Power Query, just click the Data tab in Excel 2016 or newer, called 'Get and Transform Data'. Learn more If you're using Excel 2010/2013, download the Microsoft Power Query add-in to get started. Save time and make data prep easier with data modeling tools. Reclaim hours in your day using the self-service Power Query experience familiar to millions of Excel users. Ingest, transform, integrate, and enrich data in Power BI.
Using Power Query Editor
Power Query is available in Power BI Desktop through Power Query Editor. To open Power Query Editor, select Edit Queries from the Power BI Desktop Home tab.
With no data connections, Power Query Editor appears as a blank pane, ready for data.
As soon as a query is loaded, the Power Query Editor view becomes more interesting. If you connect to the following Web data source, Power Query Editor loads information about the data, which you can then begin to shape.
The following image shows how Power Query Editor appears after a data connection is established.
| No. | Description ||---------|-------------|| 1 | On the ribbon, many buttons are now active so you can interact with the data in the query. || 2 | In the Queries pane, queries are listed and available for selection, viewing, and shaping. || 3 | In the center pane, data from the selected query is displayed and available for shaping. || 4 | In the Query Settings pane, the properties and applied steps for the selected query are listed. |
The following sections describe each of these four areas—the ribbon, the Queries pane, the data view, and the Query Settings pane.
The query ribbon
The ribbon in Power Query Editor consists of five tabs—Home, Transform, Add Column, View, and Help.
The Home tab contains the common query tasks, including the first step in any query, which is Get Data. The following image shows the Home ribbon.
To connect to data and begin the query building process, select the Get Data button. A menu appears, providing the most common data sources.
You use the Transform tab to access common data transformation tasks, such as adding or removing columns, changing data types, splitting columns, and others important to know that the underlying data is not changed; rather, Power Query Editor adjusts and shapes its view of the data, and any interaction it has with the underlying data is based on that shaped and modified view.
In the Query Settings pane, you can rename steps, delete steps, or reorder the steps as you see fit. To do so, right-click to select the step in the Applied Steps section, and choose the action you want. All query steps are carried out in the order in which they appear in the Applied Steps pane.
The advanced editor
If you want to see the code that Power Query Editor is creating with each step, or want to create your own shaping code, you can use the advanced editor. To open the advanced editor, select the View tab on the ribbon, and then select Advanced Editor. A window appears, showing the existing query code.
You can directly edit the code in the Advanced Editor window. To close the window, select the Done or Cancel button.
Saving your work
When your query is where you want it, you can have Power Query Editor apply the changes to the data model in Power BI Desktop and then close Power Query Editor. To do that, on the Power Query Editor File menu, select Close & Apply.
As it applies the changes in your query, Power BI Desktop displays the status of the operation.
After you have your query where you want it, or if you just want to make sure your work is saved, Power BI Desktop can save your work in a .pbix file.
Power Query is available in Power BI Desktop through Power Query Editor. To open Power Query Editor, select Edit Queries from the Power BI Desktop Home tab.
With no data connections, Power Query Editor appears as a blank pane, ready for data.
As soon as a query is loaded, the Power Query Editor view becomes more interesting. If you connect to the following Web data source, Power Query Editor loads information about the data, which you can then begin to shape.
The following image shows how Power Query Editor appears after a data connection is established.
| No. | Description ||---------|-------------|| 1 | On the ribbon, many buttons are now active so you can interact with the data in the query. || 2 | In the Queries pane, queries are listed and available for selection, viewing, and shaping. || 3 | In the center pane, data from the selected query is displayed and available for shaping. || 4 | In the Query Settings pane, the properties and applied steps for the selected query are listed. |
The following sections describe each of these four areas—the ribbon, the Queries pane, the data view, and the Query Settings pane.
The query ribbon
The ribbon in Power Query Editor consists of five tabs—Home, Transform, Add Column, View, and Help.
The Home tab contains the common query tasks, including the first step in any query, which is Get Data. The following image shows the Home ribbon.
To connect to data and begin the query building process, select the Get Data button. A menu appears, providing the most common data sources.
You use the Transform tab to access common data transformation tasks, such as adding or removing columns, changing data types, splitting columns, and others important to know that the underlying data is not changed; rather, Power Query Editor adjusts and shapes its view of the data, and any interaction it has with the underlying data is based on that shaped and modified view.
In the Query Settings pane, you can rename steps, delete steps, or reorder the steps as you see fit. To do so, right-click to select the step in the Applied Steps section, and choose the action you want. All query steps are carried out in the order in which they appear in the Applied Steps pane.
The advanced editor
If you want to see the code that Power Query Editor is creating with each step, or want to create your own shaping code, you can use the advanced editor. To open the advanced editor, select the View tab on the ribbon, and then select Advanced Editor. A window appears, showing the existing query code.
You can directly edit the code in the Advanced Editor window. To close the window, select the Done or Cancel button.
Saving your work
When your query is where you want it, you can have Power Query Editor apply the changes to the data model in Power BI Desktop and then close Power Query Editor. To do that, on the Power Query Editor File menu, select Close & Apply.
As it applies the changes in your query, Power BI Desktop displays the status of the operation.
After you have your query where you want it, or if you just want to make sure your work is saved, Power BI Desktop can save your work in a .pbix file.
To save your work as a .pbix file in Power BI Desktop, select File > Save (or File > Save As), as shown in the following image.
Microsoft Power Query For Excel Mac Download
Next step
In this quickstart, you learned how to use Power Query Editor in Power BI Desktop and how to connect to data sources. To learn more, continue with the tutorial on shaping and transforming data with Power Query.
4 October 2019
For several years now, the Windows platform has introduced a powerful set of Get & Transform Data / Power Query tools, starting way back with Excel 2010. We have a Power Query blog each Wednesday that keeps you apprised of all the things you can do with the Extract, Transform and Load (ETL) tool. But it's been missing from Mac Excel.
Back in June, there was a little teaser of what was to come with the ability to undertake limited Power Query query refreshes for CSV, JSON, Text, XLSX and XML files only. Well, today, Microsoft has announced the first step towards full support for Power Query in Excel for Mac.
Download Power Query For Mac
[Given they have officially called it 'Power Query in Excel for Mac' does this mean the Get & Transform moniker is to be retired..? We shall have to wait and see!]
This 'Phase 1' release allows you to refresh your Power Query queries on Mac from Text, CSV, XLSX, XML and JSON files (yes, we've just said most of that has been around from June), but you can author queries with VBA.
This new functionality is live for all Office 365 subscribers in Excel for Mac running version 16.29 (19090802) and later. If you are running an earlier version, you will need to update.
To refresh queries generated from Text, CSV, XLSX, XML or JSON files, triggering the Refresh command is done the same way as previously, e.g.
- Click on the Data tab of the Ribbon, then choose ‘Refresh All'
- Right-click on your query table, then click Refresh
- Right click on your PivotTable, then click ‘Refresh Data'
- Use a VBA script
- etc.
It should be noted that the first time you try to refresh your workbook queries, you may need to update the location of the data source so that it works on your Mac. To do this, click the Data tab on the Ribbon -> Connections -> select the desired connection -> click Change File Path button to update it.
Furthermore, you may also create and manage Power Query queries in your workbook using VBA. Any existing macros and VBA scripts that reference Workbook.Queries and WorkbookQuery entities in the Excel's object model will work in Excel for Mac as expected. You may still need to adjust your scripts to reflect the notion of a file path on a Mac (e.g./Users/USERNAME/Desktop/data.csv instead of C:UsersUSERNAMEDesktopdata.csv).
Remember, this is only the start ('Phase 1'): with Microsoft pushing to have 'one Excel', you can bet your bottom dollar further features will be coming soon. After all, Mac Excel is still a long way behind. Maybe they will Get the picture soon and Transform it shortly.