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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
admin_xlsior
Post Prodigy
Post Prodigy

Filter one table based on other table still in Power Query

Hi guys,

 

In Advance Query (Power Query) can we filter 1 table based on other table ?

For example I have table Products which has column Active (Yes/No). I have filtered this during Transform data, to Yes only.

So at Transform data as well, I want the other Table which is TransactionTable to only have ProductId that in my table Products=Active.

 

I can do the filter in reports of course, by select Product Id "is not blank" because obviously after put relationship between this 2 tables, it will result blank Product Id in Transactions.

 

But I actually don;t want this, I want at time we in Transform or in Power Query, transactions table already filtered.

 

I'm using Direct Query, btw

 

Thanks,

 

 

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @admin_xlsior 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Products:

a1.png

 

Transcation:

a2.png

 

You may add a new step for 'Transcation' table with the following m codes,

= let
lst = Table.SelectRows(Products,each [IsActive]="Yes")[ProductID],
result = Table.SelectRows(#"Changed Type",each List.Contains(lst,[ProductID]))
in
result

 

a3.png

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @admin_xlsior 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Products:

a1.png

 

Transcation:

a2.png

 

You may add a new step for 'Transcation' table with the following m codes,

= let
lst = Table.SelectRows(Products,each [IsActive]="Yes")[ProductID],
result = Table.SelectRows(#"Changed Type",each List.Contains(lst,[ProductID]))
in
result

 

a3.png

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Awesome!

 

Just what I need, Thank you very much, Allan. 😇

MattAllington
Community Champion
Community Champion

You will need to do a combine tables with an inner join between the product table and the transaction table. I don't know if you can do this with direct query - I assume you can. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors