Powerquery reference current query

rdsk 21 Reputation points
2023-06-12T10:20:27.2466667+00:00

Hi, I need to but cannot find a way to fill a column with the name of the current query which happens to be the name of an excel table and also the name of the sheet on which that table sits. I load the table into powerquery and it gets named after the table which is then referenced as the first source row using Excel.Currentworkbook...

There seems no code method to do this and I have to manually type in the name of the query based on my search of others who have attempted similar eg https://community.fabric.microsoft.com/t5/Desktop/Refer-to-current-Query-Name-in-formula/m-p/446665

Chatgpt kept suggesting functions that are not available (seemed to be bluffing) and so was useless.

If there was one query that would be ok but I have a many new queries every day and want to automate as much as possible. At present I create the query based on the table and then copy and paste several rows of code into the query using the Advanced Editor.

This seems a major and basic gap in power query M language capability.

How can this be requested as a new feature? Unless that is you can show me a way to do this.

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,937 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.