Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have a bunch of Excel workbooks with a table in them.
Some tables have the name "Table1", while some others have another name.
Power Query built a function like:
let
Source = (Parameter1) => let
Source = Excel.Workbook(Parameter1, null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data]
in
Table1_Table
in
Source
Which is breaking in the cases where the table has a different name.
How do I adapt this code to get the first table it finds within the workbook irrespective of the name?
Thanks!
Solved! Go to Solution.
let
Source = (Parameter1) => let
Source = Excel.Workbook(Parameter1, null, true),
Table1_Table = Table.SelectRows(Source, each ([Kind] = "Table"))[Data]{0}
in
Table1_Table
in
Source
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@AlienSxthanks for helping!
The Excel object contains multiple objects, like sheets, named ranges and tables.
By 1st table, I mean, whatever name it is, I want the first it finds, because I know that each file contains only one.
let
Source = (Parameter1) => let
Source = Excel.Workbook(Parameter1, null, true),
Table1_Table = Table.SelectRows(Source, each ([Kind] = "Table"))[Data]{0}
in
Table1_Table
in
Source
Hello, @webportal what is "first table"? Run
Excel.Workbook(Parameter1, null, true)
with some Parameter1 value. You get the list of items in that workbook. Okay, filter "Kind" column to get tables only. How do pick "first" table? What is it?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.