Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have 50+ tables that I need to include the name of, as a column in the table. I would rather not go the 'add a custom column with the name of the table ' route.
I thought there would be something like Table.Name that I could use, but I sure can't find it.
This doesn't work:
Text.Combine({Text.From([EAREA], "en-US"), Text.From([ENUMBER], "en-US"),Text.From([Table.Name], "en-US")}, "-")
Solved! Go to Solution.
As @lbendlin mentioned, the key is to use #shared in your query. Here is some M code to give you a list of tables in the current model.
let
Source = #shared,
#"Converted to Table" = Record.ToTable(Source),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Value.Is([Value], Table.Type)),
#"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] = true))
in
#"Filtered Rows"
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @pabeader ,
Please check if the method @mahoneypat provided could meet your requirements.
And this blog explains in detail: Get List of Queries in Power BI - RADACAD.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
As @lbendlin mentioned, the key is to use #shared in your query. Here is some M code to give you a list of tables in the current model.
let
Source = #shared,
#"Converted to Table" = Record.ToTable(Source),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Value.Is([Value], Table.Type)),
#"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] = true))
in
#"Filtered Rows"
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@ImkeF has answered that question a while back.
Is there a way to get a table name in Power Query? (microsoft.com)
I read that and that is exactly what I don't want to do. Assume that I have no idea what the table names are going to be. I need some way to get the table name from the object itself.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.