Forum Discussion
Is there a way to expose the table name in Power Query?
- 5 years ago
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
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