Forum Discussion

AnotherBIUser's avatar
3 years ago
Solved

Creating a List of Queries and Fields from Model

Hello,

 

I am currently trying to create a powerquery tool that will take all the queries (100+) and create a new query that has two columns:

1) The Fields in the queries

2) The name of the query the field came from 

I need a simple list of each query and the fields that are inside of them. 

 

I could manually transform each of the queries (unpivot & add custom column with a typed in name of the query), but with this many queries I would prefer to avoid that. 

 

Any thoughts/ideas? Apprecaite any help the forms can offer!

  • Hi

     

    = Table.ExpandListColumn(
    Table.RemoveRowsWithErrors(
    Table.TransformColumns(
    Record.ToTable(#shared),
    {{"Value", Table.ColumnNames}})
    ),
    "Value")

     

    Stéphane 

2 Replies

  • Hi

     

    = Table.ExpandListColumn(
    Table.RemoveRowsWithErrors(
    Table.TransformColumns(
    Record.ToTable(#shared),
    {{"Value", Table.ColumnNames}})
    ),
    "Value")

     

    Stéphane