Forum Discussion
Refer to current Query Name in formula
- 8 years ago
Hi,
To my knowledge, a query can't refer to its own name directly.
But I think you can achieve what you're trying to do using the Expression.Evaluate function, as long as you have a way of coming up with a list/table containing the table names as text values.
Here's an idea which could be a starting point.
If you store the names of two tables to be appended in Table1Name and Table2Name, then this expression will append those two tables:
Expression.Evaluate( Table1Name, #shared ) & Expression.Evaluate ( Table2Name, #shared )
or alternatively
Expression.Evaluate( Table1Name & " & " & Table2Name, #shared )
You could have a table with rows containing the pairs of table names, and use Expression.Evaluate within a custom column.
Anyway, that may be useful in some way.
Regards,
Owen
- 3 years ago
You can use #sections in Power Query to find the list of table names, and refer to it dynamically. Solved!
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
You can use #sections in Power Query to find the list of table names, and refer to it dynamically. Solved!
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
A step-by-step on how to do this: Get List of Queries in Power BI - RADACAD