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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Transform File pulling data from other tab

Hi, 

 

I have a power bi file that is pulling data from thousands of excel files. I want the BI to pull a certain tab all with the same name in all the files. It works in most cases but there are a few files where is pulls in data from tabs with similar names. The tab I want to pull is "Final_Payment HW" the tab is is also pulling is "Payment HW". Below is the Transform file logic. Has anyone incountered this issue? 

 

= (Parameter1) => let
Source = Excel.Workbook(Parameter1, null, true),
#"Final_H&W_Sheet" = Source{[Item="Final_Payment HW",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"Final_H&W_Sheet", [PromoteAllScalars=true])
in
#"Promoted Headers"

 

Thanks!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Basing on just the M Script itself, your query shouldn't be pulling data other than from Final_Payment HW. In fact if you change the item name into something else and it doesn't exist, the query would throw an error. 

 

Below is a screenshot of a typical Source step with an excel file as the data source and the typical M script to retrieve the contents of Table in Data column in the first row would be = Source{[Item="Sheet1",Kind="Sheet"]}[Data].

danextian_0-1665835661468.png

Now if I changed the item name to just Sheet instead, that would result to an error as Sheet doesn't exist iin column Item.

danextian_2-1665836222477.png

 

danextian_1-1665836201391.png

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Basing on just the M Script itself, your query shouldn't be pulling data other than from Final_Payment HW. In fact if you change the item name into something else and it doesn't exist, the query would throw an error. 

 

Below is a screenshot of a typical Source step with an excel file as the data source and the typical M script to retrieve the contents of Table in Data column in the first row would be = Source{[Item="Sheet1",Kind="Sheet"]}[Data].

danextian_0-1665835661468.png

Now if I changed the item name to just Sheet instead, that would result to an error as Sheet doesn't exist iin column Item.

danextian_2-1665836222477.png

 

danextian_1-1665836201391.png

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
lukiz84
Memorable Member
Memorable Member

Thats very strange. Can you show a picture of the excel tab in the file where it's pulling "Payment HW" from?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.