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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aqsa31
Helper II
Helper II

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 @aqsa31 

 

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!

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 @aqsa31 

 

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors