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
j_ocean
Helper V
Helper V

Ingesting Excel Files with a Variable Number of Sheets

I have a Dataflow ingesting/combining a folder full of excel files from sharepoint. The files are dropped by another user, and sometimes its a single sheet but sometimes its two sheets...with the data on the second one.

 

I know I can ingest using the sheet index e.g., a single sheet file is index 0, and not have to worry about sheet names. The problem is I would sometimes need index 0 and sometimes index 1.

 

Is there a way to check, file-by-file, how many sheets there are and adjust the sheet index accordingly?

 

I can think of several workarounds outside PQ but as a rule I'd like to engineer around this sort of thing.

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Two potential approaches:

1. use try ... otherwise - try on index 1 and do index 0 in the otherwise

2. keep them both and then use the max row for each workbook with Table.Max

 

Pat

Microsoft Employee

Helpful resources

Announcements
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