Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamically append Excel tabs from multiple Excel files from folder

HI All,

 

I  have a folder in which Excel files are periodically saved. These excell files contain multiple tabs of data per year and every Excel file is 100% identical to one and other.

Example:

File: Sales data 2020 with tab: Sales per country, Sales per customer

File: Sales data 2019 with tab : Sales per country, Sales per customer

 

I want to append the data to Sales per country Total, and Sales per Customer Total. 

This I can do in Power query fairly ease because the columns names and make up of the tabs is always Identical. 

However it can happen that a 3rd 4rt etc tab is added in all excel files and I would like that Power Query automatically creates the 3rd and 4th Total table. 
eg: 

File: Sales data 2020 with tab: Sales per country, Sales per customer, Sales per person, Sales per city

File: Sales data 2019 with tab : Sales per country, Sales per customer, Sales per person, Sales per city

 

Can you automate Power Query in a way that it always appends all excel tabs which have the same name into a new total table over multiple Excel files in the same folder??

1 REPLY 1
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

Not sure how you did for your other two Total tables, this is the one I normally use to read from Folder. Prior to promote header, you can specify your condition to select Name/Item/Kind/Hidden, combine all tabs you want. And you can re use it and modify the condition to read all other tables with the same conditions.

 

let
    Source = Folder.Files("C:\Users\yourFolderPath"),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.PromoteHeaders( Table.SelectRows( Excel.Workbook([Content]), each [Name]="Sales per person")[Data]{0})),
    Custom1 = Table.Combine( #"Added Custom"[Custom])
in
    Custom1

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.