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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Dynamically Change Excel Worksheet Tab Name in Power Query

My project sends a daily file, which goes through a Power Automate process and saved to my departments SharePoint site. The Excel worksheet name of the file changes based on who sent the email. The file name, data, structure, etc... are identical, except for the worksheet name. Different worksheet tab names cause errors in the power bi - power query process.

 

My question: Is there a way to edit my query to account for different worksheet names dyanmically without manual intervention everytime it changes?  

Is there a way to update the Excel Tab to Sheet1 if named something else in Power Query?

 

The normal comes as "Sheet1" and everything else is a variation of "28 DAY FORECAST." The variations include different spacing, or underscores. 

 

= (Parameter1 as binary) => let
Source = Excel.Workbook(Parameter1, null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data], // Item="Can change in automated process"
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true])
in
#"Promoted Headers"

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

@Anonymous if that Sheet is the only object in your files then simply remove Item name selection

Sheet1_Sheet = Source{[Kind="Sheet"]}[Data]

View solution in original post

1 REPLY 1
AlienSx
Super User
Super User

@Anonymous if that Sheet is the only object in your files then simply remove Item name selection

Sheet1_Sheet = Source{[Kind="Sheet"]}[Data]

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.