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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tmk123
Helper II
Helper II

Source (Excel) has dynamic sheet name

Hi All, 

 

My source is an Excel file.  There is only one sheet found within the Excel file and it is dynamic.  

 

File 1 has a sheet name of:  TRM215-1106217

File 2 has a sheet name of:  TRM215-1113231

Tmk123_0-1688656977433.png

 

 

I put a file into a folder daily, and Power BI takes the most recent file as its source.  I followed the steps here for reference:  https://wkrzywiec.medium.com/getting-data-from-the-latest-file-in-a-folder-using-power-query-51dfa4b...

(as you can see in the instructions found within the link, the source is a "folder").  

 

If I look at the Transform file section, this is what is listed there now:

 

= (Parameter3 as binary) => let
Source = Excel.Workbook(Parameter3, null, true),
#"TRM215-1" = Source{[Name="TRM215-1106217"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"TRM215-1", [PromoteAllScalars=true])
in
#"Promoted Headers"

 

The sheet name update is not allowing Power BI to refresh.   I see that it referencing:  [Name="TRM215-1106217"].   Is there a way to take the first sheet, regardless of the name?

 

I tried replicating previous solutions to this issue but have not succeeded.  Can someone please help me?  Obviously, I am new 🙄.  Thank you!!!

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Replace the name reference

 

#"TRM215-1" = Source{[Name="TRM215-1106217"]}[Data],

 

with an index reference

 

#"TRM215-1" = Source{0}[Data],

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Replace the name reference

 

#"TRM215-1" = Source{[Name="TRM215-1106217"]}[Data],

 

with an index reference

 

#"TRM215-1" = Source{0}[Data],

That worked!  Thank you so much @lbendlin !

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.