Forum Discussion

tgjones43's avatar
tgjones43
Icon for Helper IV rankHelper IV
6 years ago

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

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity 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()
    )

     

    • tgjones43's avatar
      tgjones43
      Icon for Helper IV rankHelper IV

      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's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        tgjones43 

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