Forum Discussion
Adding the query name to a new column
Hi Anonymous ,
You can try using the "#sections" function in Power Query.
In Power Query, Go to "New Source" --> Blank Query. Then type in "= #sections"
Click on "Record". This will show you a list of all queries in your file. Convert this to a table
Filter the name column using the name of the query and click on "Table" to expand the query. You will now see a reference to a specific row in the prevous step, which points to the query name.
We will use this reference now to create a new column. Click on 'Add Column' and type in the specific row that we obtained previously.
This will create a new column with each row having a record datatype.
Expand the column and select the "Name" field
This gives us the query name in each row
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂