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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors