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
TheHawkmeiser
New Member

Attempting to filter a table based on values present in another table's column

Hello,

 

I will provide  simplified example of what I am trying to do. The main goal is to filter table 1 based on table 2 Loc ID values present in table 1. I am still learning BI and may be missing something obvious, but my approach was to generate a new table from table 1 using table 2 loc ID as a filter expression, but it seems you cannot use a table object for this purpose. Table 1 is a relatively large set with more than 10 million rows, Table 2 is smaller(~3000) and has different fields but they share the Loc column.

 

Table 1

Loc              Cat

1045            A

4555            A

6647            B

9996            C

3325            D

 

Table 2

Loc

6647    

9996

5555

3333

0009

 

Expected Outcome

Loc              Cat

6647            B

9996            C

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Assuming there are no duplicates in the Loc column of Table 2, create a relationship (Many to One and Single) from Table 1 to Table 2.  To your visual, drag Loc from Table 2.  Write this measure

Measure = max('Table 1'[Cat])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Try this: 

 

Apply this relationship:

Power5_0-1700247451154.png

Next, create a table in PBI and add "Loc" and "Cat" as the columns in the table.

 

After, select a slicer and add "LOC" as the filter for the slicer.

Helpful resources

Announcements
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.