Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a query that has multiple steps (e.g., steps 1, 2, 3, 4, etc). I want at step 4 of the query to reference step 2 of the query (I'm doing this because I need to do a grouping).
How can I have the query reference itself? The way I've dealt with this in the past is that I just copy and paste the query and keep steps 1 and 2....the query is now running very slow (I think because it has to basically do the query twice) and I want to see if there is a way to speed it up.
Solved! Go to Solution.
Hi @Anonymous
If you reference the previous step or even query there is a chance it will run the code twice anyway as steps are not loaded or stored anywhere during the execution process or else you use Table.Buffer or List.Buffer function. If you want to avoid expecting the same query twice, you can watch this video it might help you.
https://www.youtube.com/watch?v=3uKNNZqBIkg&t=764s
If this is not the answers to your requirement you can try explaining your scenario in more detailed.
To reference an earlier step, just right click on your last step and choose "Insert Step After". Then, in the formula bar type in
= #"Changed Type" (or whatever the earlier step is named)
Good practice is to rename your steps so they are more meaningful especially when you start jumping around the query. Also good to rename with no spaces so you don't have to worry about all the #" "s.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
To reference an earlier step, just right click on your last step and choose "Insert Step After". Then, in the formula bar type in
= #"Changed Type" (or whatever the earlier step is named)
Good practice is to rename your steps so they are more meaningful especially when you start jumping around the query. Also good to rename with no spaces so you don't have to worry about all the #" "s.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @Anonymous
If you reference the previous step or even query there is a chance it will run the code twice anyway as steps are not loaded or stored anywhere during the execution process or else you use Table.Buffer or List.Buffer function. If you want to avoid expecting the same query twice, you can watch this video it might help you.
https://www.youtube.com/watch?v=3uKNNZqBIkg&t=764s
If this is not the answers to your requirement you can try explaining your scenario in more detailed.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.