Quantcast
Channel: Power Query Archives –
Viewing all articles
Browse latest Browse all 111

Reference an intermediate step from a different query in Power Query

$
0
0

When you reference another query in Power Query you will automatically get the results of the final step. But what if you want to reference a step that sits within that referenced query?

One solution would be to split up that query into 2 and reference the final result of the splitted query. But that could result in additional query time, as the data might be pulled from the source twice (once for each query).

A potentially better alternative is to add the result of the intermediate step as metadata of the query itself. That way you could pick steps just as you need them.

To do so, you add a metadata record to the final step of the query. If you need just one intermediate step, it could look like so:

Using the “meta” expression does the trick here: You reference the previous step (“Final Step”), add the meta keyword and then add the record containing the referenced step (“Intermediate Step”). The name of the record field “ReferenceStepIntermediate” is what you need to address the value from a different query:

This is an unintrusive way to make intermediate steps available for other queries without breaking the logic that exists in your solution so far.

Please check the file attached to follow the steps: Reference-Step-in-another-Query.pbix

Enjoy and stay queryious 😉

Edit: There are nice other ways to this as well:
https://goodly.co.in/extract-any-step-power-query/

https://www.linkedin.com/feed/update/urn:li:activity:7029530911066968066?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7029530911066968066%2C7029567762314223616%29

The post Reference an intermediate step from a different query in Power Query appeared first on .


Viewing all articles
Browse latest Browse all 111

Latest Images

Trending Articles



Latest Images