Shape or transform a query (Power Query)

Important   This article applies to Power Query, a data analysis feature available for Excel that lets you discover, combine and refine data. You may need to enable Power Query in Excel. You can also download and install the most recent version of Power Query for Excel, which automatically enables it. Power Query technology is also built into the Power BI Desktop, which is a stand-alone report authoring and data transformation tool for Power BI.

Data shaping is a common task in Excel that involves reducing and rearranging one or more tables into a subject table that matches your data analysis requirements. Power Query provides an intuitive user interface to help you define data shaping and transformation steps with simple user actions over a set of data.

These steps are automatically run every time a query is refreshed, and can be modified later to match changes in the data or in your analysis needs. You can shape data from multiple data sources by adding, removing or editing query steps. Query steps replace the need to manually acquire and reshape data in Excel.

Power Query enables you to import data into Microsoft Excel from a wide variety of data sources including other Microsoft Excel Workbooks, SQL Server, Oracle, IBM DB2, SharePoint, and other structured data. For more information about connecting to a data source, see Connect to a data source.

Once you connect to a data source, you use the Query Editor to shape your data into a useful format. As you shape your data source, Power Query automatically creates a sequence of query steps associated with a specific editor activity. For example, a sequence of query steps is created while you work in the query editor to connect to a data source, promote a row to column headers, sort rows, and filter a table. For more information about how to shape data, see Shape data.

Note   For a very quick video on how to display Query Editor, see the end of this article.

Example query steps

Query Editor activity

Query step

Connect to a data source


Expand a column containing a related table

Expand NewColumn

Rename a column


Sort a table


Expand table link

Note   The Query Editor only appears when you load, edit, or create a new query using Power Query. The following video shows the Query Editor window appearing after editing a query from an Excel workbook. To view the Query Editor without loading or editing an existing workbook query, from the Get External Data section in the Power Query ribbon tab, select From Other Sources > Blank Query. The following video shows one way to display the Query Editor.

How to see Query Editor in Excel

Applies To: Excel 2010, Excel 2013

Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Change language