Forum Discussion
Append queries dynamically in Power Query
Hi Alex_Ooi
#sections can probably work for you
Take a look at https://radacad.com/get-list-of-queries-in-power-bi
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hey AlB , thanks for the reply. I managed to get to where I wanted to be, only thing is... The whole table went blank after I hit close & apply.
- AlB6 years agoCommunity Champion
You could extract the list of queries you are interested in using #sections and then build the full expression on a string and use
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
- Alex_Ooi6 years agoHelper IV
I have never worked with Expression.Evaluate before in Power Query. Can you share more with me? Do I add this step at the end of my query or something? I've read the documentation you linked me, but I still don't quite grasp how does that help in the situation here. Any detailed guide is much appreciate. Thank you so much already, AlB
- AlB6 years agoCommunity Champion
You do not actually need it Expression.Evaluate. It would be complicating things unnecessarily. You can just use #sections to get the list of all queries, filter out the ones you don't want and then combine (append) the remaining ones to get the final result. This example selects and appends all queries whose name starts with "Table1":
let Source=#sections, Section1 = Source[Section1], #"Converted to Table" = Record.ToTable(Section1), #"Filtered Rows" = Table.SelectRows(#"Converted to Table", each Text.StartsWith([Name], "Table1")), res = Table.Combine(#"Filtered Rows"[Value]) in resPlease mark the question solved when done and consider giving kudos if posts are helpful.
Cheers