March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi, I am new with Microsoft Power BI so please bear with me. What I am trying to do is, I have a query (Web-API) through which I am getting some data and now I need to make another query, which is basically many queries, based on a variable from the first query-table.
In other words query A has a column, which I want to use as variable to make 2nd (multiple) queries, using query A's one column contents. Now when I try to do that by converting query A's that column in to a list and creating a parameter which refers to that list and when I try to run the query it gives and error that (something like) your query is refering to another query.
Can someone help me how to overcome that? Bascially the source for both queries are the same. I just want to use the 1st query's one column as variable for another query, so I can make multiple queries. Thanks in advance.
Solved! Go to Solution.
Hi @WaheedAli ,
You can c convert your second query to a funciton (follow the steps in https://radacad.com/custom-functions-made-easy-in-power-bi-desktop)
Then , In your first query with the list of IDs, go to Add Column > Invoke Custom Function, choose the function you just made as the function query, and change the table drop down from text to column name and select the variable column in first query .
For more details, please refer to the similar post :https://community.powerbi.com/t5/Desktop/JSON-query-based-on-another-query/td-p/177461
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @WaheedAli ,
You can c convert your second query to a funciton (follow the steps in https://radacad.com/custom-functions-made-easy-in-power-bi-desktop)
Then , In your first query with the list of IDs, go to Add Column > Invoke Custom Function, choose the function you just made as the function query, and change the table drop down from text to column name and select the variable column in first query .
For more details, please refer to the similar post :https://community.powerbi.com/t5/Desktop/JSON-query-based-on-another-query/td-p/177461
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Dear Dedmon Dai,
Thank a lot man... yahoooooo... I have done with your help. Since I am a network eng and not a programmer so i would have never done it without your help. Much appreciated. Thanks a lot 🙂
@WaheedAli Hey did you check the below links
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
http://biinsight.com/power-bi-desktop-query-parameters-part-1/
https://www.excelguru.ca/blog/2016/04/28/pass-parameters-to-sql-queries/
Proud to be a Super User!
Dear negi007,
Thanks a lot for guiding me but on the mentioned links, on the first link, it says the below. So I am not sure it will help me or not but thanks a lot for guiding me. I learnt a lot from it, since I am new with Power BI. Thanks
"Currently, only a static list of Accepted Values (or any value of the expected type) are accepted. In future updates, we will enable users to bind the list of Accepted Values for a parameter to the output of another query. This would enable dynamic sets of options to be displayed to the user, maybe even based on their selection for a previous parameter. A typical example for this would be making a “City” parameter change the list of values to select from, based on another parameter that allows users to specify a “State”. Also in a future update, we will enable users to select more than one value from the list of Accepted Values, rather than just one as it is the case in the current product version."
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
86 | |
77 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |