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

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

Reply
smjzahid
Helper V
Helper V

How to combine the first tab of each xls file using Combine File Function

I have mutliple Excel file ( each file has 5 to 6 different tabs). However, I want to combine the first tab of each file only into 1 single logical file. (The data structure for all files )

for eg: 

 

Excel File 1 has these tabs

smjzahid_0-1624282353867.png

Excel File 2 has below tabs

smjzahid_1-1624282411371.png

I want to only combine the Week 1, Week 2 and son tabs only from individual files. How do I achieve this in Power Query

4 REPLIES 4
Anonymous
Not applicable

Hi @smjzahid ,

 

Based on my research, I found the workaround.

The entire operation is merged in Excel first, and then you only need to connect to the integrated Excel.

You need to Run Excel Consolidate in Excel. For more details, please refer to Consolidate data in Excel and merge multiple sheets into one worksheet.

excel-consolidate.png

 

Overall, there are other four ways to merge Excel worksheets into one without copying and pasting:

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Vera_33
Resident Rockstar
Resident Rockstar

Hi @smjzahid 

 

Put all Excel files in a folder, read from it, basical find the [Item] contains "Week"

 

let
  Source = Folder.Files("C:\Users\yourFolderPath"), 
  AddCustom = Table.AddColumn(
    Source, 
    "Custom", 
    each Table.PromoteHeaders(
      Table.SelectRows(Excel.Workbook([Content]), each Text.Contains([Item], "Week"))[Data]{0}
    )
  ), 
  Custom1 = Table.Combine(AddCustom[Custom])
in
  Custom1

 

Hi @Vera_33 

 

Thanks for your prompt reply, cant put all files in 1 single folder. The team that owns data must split the files in separate folders to keep it organised, and i dont have permission to copy the files and place those in 1 single folder. they need to be like that only for eg:

 

smjzahid_0-1624285738835.png

 and then every Period has 8 to 10 different xls files (in which I only need to combine the very first tab) as shown in my post above)

 

for eg; PERIOD 1 has 7 different files as shown below

 

image.png

and so on, is ther a workaround to achieve this, without disturbing the folder structure please.

 

Thanks for your help

Hi @smjzahid 

 

Do you have all these folders in one folder? I mean you have a folder containing Period 1 folder, Period 2 folder, etc. Then read from this folder, it can read all the files in the sub folders, then you can try to locate items contains "Week" in name

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors