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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors