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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rsderby68
Resolver I
Resolver I

How to filter results for one table by column in another table?

I have a table that contains a customer_id column which a few thousand entries.  I have another table that lists a customer_id column of "bad" ID's that I want to filter OUT OF the first table.  The end result would be the first table minus any rows of the "bad" customer_id listed in the second table.  Help?  

2 ACCEPTED SOLUTIONS
Nankaina
Helper I
Helper I

There are likely several ways to do this. I would approach it by adding a calculated column to your first table which tests whether the customer_id is within the second table's list:

 

Good IDs = IF(Table1[customer_id] in VALUES(Table2[bad_ids]), True, False)

 

 You can edit the True and False outputs to be anything you'd like, and slice by "True" to see only those customers without bad IDs.

View solution in original post

rsderby68
Resolver I
Resolver I

I actually got it to work using a version of: 

 

FILTER ( Table1, NOT Table1[Id] IN DISTINCT ( Table2[Id] ) )

 

It's amazing how much you can learn at Power BI when you are dealing with a crappy data source!  🙂  Thanks All! 

View solution in original post

2 REPLIES 2
rsderby68
Resolver I
Resolver I

I actually got it to work using a version of: 

 

FILTER ( Table1, NOT Table1[Id] IN DISTINCT ( Table2[Id] ) )

 

It's amazing how much you can learn at Power BI when you are dealing with a crappy data source!  🙂  Thanks All! 

Nankaina
Helper I
Helper I

There are likely several ways to do this. I would approach it by adding a calculated column to your first table which tests whether the customer_id is within the second table's list:

 

Good IDs = IF(Table1[customer_id] in VALUES(Table2[bad_ids]), True, False)

 

 You can edit the True and False outputs to be anything you'd like, and slice by "True" to see only those customers without bad IDs.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.