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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
a68tbird
Resolver II
Resolver II

Referencing an Excel Sheet Without Using Name

Hello All,

  I'm trying to summarize a folder of Excel invoices, and have done this quite a few times before with an invoked function call, but have run into this problem for the first time, hoping you can help me out.  The data that I want is always on Sheet 1 of the Excel document, but that particular sheet has a different name in each file. How can I refer to Sheet 1 without using the name? Here is the particular line in my code:

 

 

(myPath,myFile) =>
let
    Source = Excel.Workbook(File.Contents(myPath&myFile),null,true),
    #"April 18 Support _Sheet" = Source{[Item="April 18 Support ",Kind="Sheet"]}[Data],

Thanks for your help.

 

1 ACCEPTED SOLUTION
edhans
Community Champion
Community Champion

Add this line. It will get the first sheet regardless of its name.

 

= Table.SelectRows(Source, each [Kind] = "Sheet"){0}[Data]

Do that right after the SOURCE line that shows all objects in the file. You'll probably need to delete the default NAVIGATION step Power Query does.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Community Champion
Community Champion

Add this line. It will get the first sheet regardless of its name.

 

= Table.SelectRows(Source, each [Kind] = "Sheet"){0}[Data]

Do that right after the SOURCE line that shows all objects in the file. You'll probably need to delete the default NAVIGATION step Power Query does.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Thanks very much! That worked perfectly!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors