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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
bipolarminds
Frequent Visitor

Filter rows in matrix by matches with another column

I am given a datatable table1 with a column named postal_code. I created a matrix with rows being given by distinct values in postal_code. However, I would like to exclude some of these rows in the matrix, specifically those values in postal_code that do not appear in a column postal_code2 of a different table, say table2.

Is this possible?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bipolarminds ,

 

Please try new a measure like:

Measure = 
VAR _table = INTERSECT(DISTINCT('Table1'[postal_code1]),DISTINCT('Table2'[postal_code2]))
VAR _filter = IF(SELECTEDVALUE('Table1'[postal_code1]) IN _table,1)
RETURN
_filter

and apply it to the matrix's filter:

vcgaomsft_0-1673933940694.png

attach the pbix file for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @bipolarminds 

you can filter the postal_code column with a slicer or in the filter pane, or?

Thx for your answer! I'd rather not exclude the values manually since the data is getting updated on a regular basis. Isn't there a way to say 'only show those values which can be found in table2[postal_code2]'?

Anonymous
Not applicable

Hi @bipolarminds ,

 

Please try new a measure like:

Measure = 
VAR _table = INTERSECT(DISTINCT('Table1'[postal_code1]),DISTINCT('Table2'[postal_code2]))
VAR _filter = IF(SELECTEDVALUE('Table1'[postal_code1]) IN _table,1)
RETURN
_filter

and apply it to the matrix's filter:

vcgaomsft_0-1673933940694.png

attach the pbix file for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

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.