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.
Hello,
I have a set of codes where I need to create some tables and get output. Is there any possibility to write all these codes and get the final output in the power query as a table?
Solved! Go to Solution.
Hello @ImkeF ,
Thank you for your clarification. Let me share my experiance on this query.
After I did some research I found one solution to my problem.
that is called get data from query id (single line)
Let me explain it briefly
1. There are multiple tables and conditions used in my code which is around 200 lines of code but I want the last 2 tables individually.
2. I have run the entire code (exept the last two tables)
3. once I run the table 1 once query id will generate so That is my keypoint
4. select last_query_id(-1) -- to get the query id
4. selct * from table (result_scan('Table1 QUERY ID')); - Entered this in power query sql code space and got the resulsts.
This is my story about my answer- self learning gives me a lot of satisfaction.
Thank you!
Hello @ImkeF ,
Thank you for your clarification. Let me share my experiance on this query.
After I did some research I found one solution to my problem.
that is called get data from query id (single line)
Let me explain it briefly
1. There are multiple tables and conditions used in my code which is around 200 lines of code but I want the last 2 tables individually.
2. I have run the entire code (exept the last two tables)
3. once I run the table 1 once query id will generate so That is my keypoint
4. select last_query_id(-1) -- to get the query id
4. selct * from table (result_scan('Table1 QUERY ID')); - Entered this in power query sql code space and got the resulsts.
This is my story about my answer- self learning gives me a lot of satisfaction.
Thank you!
Hello @Anonymous ,
yes, if you just expect one output table, you can write all your logic in one query.
In a query, every step name is like a variable. So you can create staging logic in certain steps and reference each step from whereever you need.
But if you want to create multiple queries at one go, this is not possible with a custom script.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
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.
User | Count |
---|---|
101 | |
50 | |
19 | |
12 | |
11 |