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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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