Microsoft Power Query is a powerful tool that allows you to easily import, clean, transform, and refresh your data. One of its features is the ability to import data from a variety of sources, including tables within Excel workbooks. However, if you have a table within a table (a nested table), you might find it difficult to work with them in Power Query. In this article, we will show you how to open nested tables from Power Query in new sheets, so you can work with them more easily.
What are nested tables?
Nested tables are tables that are contained within other tables. They can be useful for organizing data, but they can also be difficult to work with. In Excel, you can create nested tables by inserting a table within a table. In Power Query, you can create nested tables by merging queries that contain tables.
Why open nested tables in new sheets?
When you import a nested table into Power Query, it can be difficult to work with it in the same query as the parent table. You might find it easier to open the nested table in a new sheet, so you can work with it separately. This can help you avoid confusion and make it easier to transform and manipulate your data.
How to open nested tables in new sheets
To open a nested table in a new sheet, you can follow these steps:
- In the Power Query Editor, select the nested table you want to open in a new sheet. You can do this by clicking on the table in the preview pane or in the Applied Steps pane.
- Right-click on the selected table and choose
Extractfrom the context menu. This will open theExtractdialog box. - In the
Extractdialog box, chooseTablefrom theExtract asdrop-down list. This will extract the nested table as a new table. - Check the
Add as new queryoption. This will add the extracted table as a new query in the Power Query Editor. - Click
OKto extract the nested table and add it as a new query. - Rename the new query to something more meaningful. This will make it easier to find and work with the nested table in the Power Query Editor.
- In the Power Query Editor, click on the new query to open it in a new sheet. You can now work with the nested table in the new sheet, separate from the parent table.
Example of opening nested tables in new sheets
Let's say you have an Excel workbook with two tables, one nested within the other. The parent table contains information about orders, and the nested table contains information about products. You want to open the nested table in a new sheet, so you can work with it separately.
To do this, you can follow these steps:
- In the Power Query Editor, select the nested table you want to open in a new sheet. In this example, it's the
Productstable within theOrderstable. - Right-click on the selected table and choose
Extractfrom the context menu. This will open theExtractdialog box. - In the
Extractdialog box, chooseTablefrom theExtract asdrop-down list. This will extract the nested table as a new table. - Check the
Add as new queryoption. This will add the extracted table as a new query in the Power Query Editor. - Click
OKto extract the nested table and add it as a new query. - Rename the new query to something more meaningful, such as
Products. This will make it easier to find and work with the nested table in the Power Query Editor. - Click on the new query to open it in a new sheet. You can now work with the nested table in the new sheet, separate from the parent table.
In this article, we have shown you how to open nested tables from Power Query in new sheets. By following the steps outlined in this article, you can easily work with nested tables in the Power Query Editor, without having to deal with the complexity of working with them in the same query as the parent table. This can help you avoid confusion and make it easier to transform and manipulate your data.
References
| Title | Link |
|---|---|
| Nested Tables in Power Query | https://www.excelguru.ca/blog/2017/03/13/nested-tables-in-power-query/ |
| Extracting Data from Nested Tables in Power Query | https://www.sqlbi.com/guides/power-query/extract-data-from-nested-tables/ |
| Working with Nested Tables in Power Query | https://www.mssqltips.com/sqlservertip/5171/working-with-nested-tables-in-power-query/ |