Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Anonymous
Not applicable

can we feed the results from the first query (learners) into the second query (lessons)

I have two tables learner and lessons. I am applying all the where clauses in the lessons table which I am already applying in the learners table for learners. My issue is that I don;t want the result from first query and pass that in the second query to get the results. So for example I have learner data like 

 

Select * from learners l where l.status = 'Active' 

Select * from lessons_log ll where ll.learnerid = :l.learnerid 

 

How can I call that second query in power bi based on the learner id from learners table 

3 REPLIES 3
v-jingzhan-msft
Community Support
Community Support

Hi @Anonymous 

 

You may try this for the second query:

SELECT ll.*
FROM learners l
JOIN lessons_log ll
ON l.learnerid = ll.learnerid
WHERE l.status = 'Active'

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Anonymous
Not applicable

I don't want a join that is the whole point. I want the learner id's from first query

to be passed into the second query ll.learnerId

Hi @Anonymous 

 

If you don't want a join in the sql statement, you may first connect to the lessons_log table without any filtering or joining, then use the merge queries feature in Power Query. 

Merge queries overview - Power Query

Inner join - Power Query

 

Best Regards,
Jing

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.