Long ago BPQ (before Power Query), I wrote a similar post on how to combine data from multiple sheets but using VBA. Now that we have Power Query, combining data from multiple sheets into a single sheet has become so much simple (& not to mention code free).
In this step by step tutorial I’ll share with you that how can you append data from multiple sheets to a single sheet using none other than Power Query
Let’s begin
Consider this Excel Workbook with Multiple Sheets
For now I have the same data across all the sheets, only difference being the dates are different
Step 1 – Create a New Sheet called “Consolidated Data”
- I am sure I don’t have to explain how to create a new sheet, just rename it to “Consolidated Data” (you can name it whatever you like)
- Make sure to Save the file after you insert and rename the sheet
Step 2 – Connect the Excel file to Power Query
- In the Data Tab
- Get Data Drop Down >> From File >> From Workbook
- Direct the navigation to the path where the workbook is saved
- Power Query will give you a list of all sheets in the workbook.
- Since we want to combine data from all sheets, click on the Excel file name (rather than choosing any particular sheet)
- The sheet names get loaded in Power Query
Step 3 – Combining Data from All Sheets into a Single Sheet
- Since we want to combine data from only on the sheets, apply a filter to the “Kind” column and keep only “Sheet”
- Next Promote the Headers by adding a Custom Column
- Add Column Tab >> Custom Column
- Write following formula =Table.PromoteHeaders ( [Data] )
- A new column with “Table” values will be inserted
- Keep only the Custom column and the Name column and “Remove other Columns”
- Now we want to exclude the sheet “Consolidated Data” (where the data will be combined), filter that sheet out from the Name column
- Now expand the Custom column
- Change the data type of the columns if required
- Done!
Step 4 – Load the Data into Excel
- Make sure to click on Load to
- This will allow you to load the data into Consolidated Data sheet
Video Lover ?
More of such tricks..
- Combine Data from Multiple Excel Files into a Single File
- Change Pivot Table Fields Calculations with VBA
- Change Pivot Table Calculations using Slicers (using DAX Power Pivot)
- Three Smartest Ways to apply filters on Data
- Filter Data with Multiple Criteria using Power Query (and automate the process..)