- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Query referencing another query
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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/
Did I answer your question? Mark my post as a solution!
Appreciate your Kudos
Proud to be a Super User!
Follow me on linkedin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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."

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-18-2024 09:38 AM | |||
01-25-2024 01:43 PM | |||
11-01-2024 07:40 AM | |||
04-19-2024 12:24 AM | |||
10-03-2024 01:26 PM |
User | Count |
---|---|
141 | |
117 | |
80 | |
65 | |
47 |