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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jushah
Regular Visitor

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.

 

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @jushah ,

 

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

vcgaomsft_1-1719192749584.png

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

vcgaomsft_0-1719192677476.png

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

View solution in original post

3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @jushah ,

 

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

vcgaomsft_1-1719192749584.png

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

vcgaomsft_0-1719192677476.png

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

jushah
Regular Visitor

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

hansontm
Resolver I
Resolver I

Create new measure Num_Customers = DISTINCTCOUNT('Table'[Customer No])
hansontm_0-1718998494916.png

 

hansontm_1-1718998522863.png

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

Top Solution Authors