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
lpriceFTW
Helper II
Helper II

Make Excel Workbook Sheet Import Dynamic

I have an M query which combines a specific sheet from multiple workbooks into one table.

 

The source is a folder which contains 12 Excel workbooks (one per month).

 

When setting up the query as a "from Folder" query, PBI automatically creates supporting queries and objects, including a sample query which has a "Navigation" step:

 

lpriceFTW_0-1692624683219.png

 

 

PBI sets up the "Navigation" query like so:

 

lpriceFTW_1-1692624728488.png

 

Where the "Item=" is a hardcoded value representing a sheet name that is contained in the sample workbook. (See image below for the table containing the items available.)

 

My problem is that the hardcoded value ("YTD Jan 2022") is a sheet name that does not apply to all 12 workbooks, as each one has a different sheet name reflecting whatever month that workbook is (Feb, Mar, Apr, etc.) See the "Source" workbook step in the following image:

 

lpriceFTW_0-1692625178246.png

 


I would like to replace the "Item="YTD Jan 2022"" with a dynamic value which selects a sheet if it contains the string "YTD".

 

How would I do this?

1 ACCEPTED SOLUTION
mlsx4
Memorable Member
Memorable Member

HI @lpriceFTW 

 

Why don't you filter, in the origin, the column by the values that starts with...? 

mlsx4_0-1692625430961.png

 

View solution in original post

2 REPLIES 2
mlsx4
Memorable Member
Memorable Member

HI @lpriceFTW 

 

Why don't you filter, in the origin, the column by the values that starts with...? 

mlsx4_0-1692625430961.png

 

Thank you! Simple and straightforward.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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