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: