Shape or transform a query

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 sample 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.

ShowLearn more about the Query Editor

You can access the Query Editor from the Navigator pane when connecting to a data source, or at any time from the Workbook Queries pane or the contextual Query ribbon tab for an existing query. To learn how to load the Query Editor, see Power Query Quick Start.

Example query steps

Query Editor activity

Query step

Connect to a data source Source
Expand a column containing a related table Expand NewColumn
Rename a column RenamedColumns
Sort a table SortedRows

Expand table link

Applies to:
Excel 2013, Excel 2010