Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Want to use the results of query1 to database1, as a filter/where clause for query2 to database2 (and query 3 for database3 as well)
Getting query1 results into XLS/PQ is easy, but how do I feed that into query 2? Guessing pass it in as some sort of list so the end result in query2 is "where ID in (results1)?"
Solved! Go to Solution.
Hi @Anonymous
Download example PBIX file with these queries.
I don't know exactly what you are doing but let's say this is Query1
let
Source = "clause one"
in
Source
So it results in a string clause one
You can use this in Query2 like this
let
Source = "where " & Query1
in
Source
The result of Query2 being where clause one
And using this in Query3
let
Source = "select * from table " & Query2
in
Source
Resulting in select * from table where clause one
I've just used strings as the result of each query but the same process applies if the query result is a table, a list, a record or whatever.
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi @Anonymous
Download example PBIX file with these queries.
I don't know exactly what you are doing but let's say this is Query1
let
Source = "clause one"
in
Source
So it results in a string clause one
You can use this in Query2 like this
let
Source = "where " & Query1
in
Source
The result of Query2 being where clause one
And using this in Query3
let
Source = "select * from table " & Query2
in
Source
Resulting in select * from table where clause one
I've just used strings as the result of each query but the same process applies if the query result is a table, a list, a record or whatever.
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Thanks Jimmy. I'm very new to this and couldn't google up any 'copy and paste' answers for what I'm trying to achieve. Can you help me with some example queries?
Hello @Anonymous
then please describe what exaclty you need to achieve. @PhilipTreacy gave you already some ideas how to handle, but there are so many ways out to do that.
So waiting from a clear instruction what you need 🙂
BR
Jimmy
Hello @Anonymous
you can use the output of a query by just using the query name in your new query. For sure you have to pay attention on the output format of your query (if it's a text, list or a table). If you have a text, just include this text in you new query. Here probably the firewall will cick in 🙂
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy