Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

powerbi filter help - select mutually exclusive records

Hi 

I have following table.

 

Customer NoProduct
1A
1B
1C
2A
2C
3A
4A
5B
6A

 

 

I want to create a measure so if the user selects A, it will only show the count who has only product A. if they select A & B, it will only show the count of users who have either product A or B or both.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Again, you need to prepare an unconnected table for the slicer:

    And create a new measure like:

    Measure = 
    VAR __slicer = ALLSELECTED('DimProduct'[Product])
    VAR __result = CALCULATE(COUNT('Table'[Customer No]), 'Table'[Product] IN __slicer)
    RETURN
    __result

    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 -- China Power BI User Group

3 Replies

  • Create new measure Num_Customers = DISTINCTCOUNT('Table'[Customer No])

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    actully it is not correct. When I select A, I need to see all the users that has ONLY product A

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Again, you need to prepare an unconnected table for the slicer:

    And create a new measure like:

    Measure = 
    VAR __slicer = ALLSELECTED('DimProduct'[Product])
    VAR __result = CALCULATE(COUNT('Table'[Customer No]), 'Table'[Product] IN __slicer)
    RETURN
    __result

    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 -- China Power BI User Group