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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tgjones43
Helper IV
Helper IV

Filter to keep rows where two specific values are both present

Hello all

 

I have the following data in a table visual and would like to create a measure I can use to filter the table so that only Site 4 is displayed i.e. records where there is a Method value for both A and B, but not A only, and not any other combination of Method values. Is this possible?

 

Thank you.

 

SiteMethod
1A
2A
2C
3A
4A
4B
5A
5B
5C
 
6 REPLIES 6
az38
Community Champion
Community Champion

@tgjones43 

try to use a measure to filter by TRUE like

Measure = 
IF(
CALCULATE(DISTINCTCOUNT(Table[Method]), ALLEXCEPT(Table, Table[Site]), Table[Method] IN {"A", "B"}) = 2,
TRUE(),
FALSE()
)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank you @az38, that formula works nicely. But how do I filter on TRUE? I was hoping to be able to filter my table to show only the true values, but when I move the measure to the visual level filter it's not possible to select anything.

az38
Community Champion
Community Champion

@tgjones43 

You also can create a calculated column with the same formula and place it to filter. It should work


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

That works nicely, thank you @az38 

 

Finally, how would I add another condition to that formula? I would like to apply this to the dataset where only the the years = 2017, 2018 and 2019. There is a related table with a [YEAR] column.

az38
Community Champion
Community Champion

@tgjones43
Try a construction like
IF(
CALCULATE(DISTINCTCOUNT(Table[Method]), ALLEXCEPT(Table, Table[Site]), Table[Method] IN {"A", "B"}, Table2[Year] IN {“2017”, “2018”, “2019”}) = 2,
TRUE(),
FALSE()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank you @az38, that solution works perfectly.

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors