Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |