- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Adding the query name to a new column
Hello All,
I have a small question. As mentioned in the picture Iam looking for a solution where I can generate a new column in power query with the own query name in it. For example if my query name is ABCDE having a data of multiple columns and multiple rowa then I should have a new column that should be having the query name which is ABCDE for each and every row. This should be reflected for each and every query in Power Query Editor. Can anyone please help me to find a formula for this one?
Note: Every query is not related to each other. Each and every query is independent.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @rohit_singh
I can't go forward from this step
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.
That you have mentioned. I cant see any reference row.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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! 🙂

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-30-2022 09:37 AM | |||
10-16-2024 01:39 PM | |||
07-08-2023 08:57 AM | |||
09-11-2024 01:52 PM | |||
12-17-2022 01:47 AM |
User | Count |
---|---|
33 | |
18 | |
14 | |
11 | |
10 |