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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
jwang19
Frequent Visitor

Count how many selected options - multiple slicers in one page

Hi experts,

 

I'd like to calculate how many selected customer in the customer slicer.

 

Here's my current measure and demo file attached: 

Count of Selected Customer = CALCULATE( DISTINCTCOUNT(Customer_Visit_Plan[Customer]), ALLEXCEPT(Customer_Visit_Plan,Customer_Visit_Plan[Customer]))
 

It works when all other slicers aren't selected, but if we choose other slicers, the measure shows incorrect number as below.

Ex. It should be 2 instead of 1 in this case.

jwang19_0-1691718684348.png

 

Demo File 

 

Thanks in advance!

1 ACCEPTED SOLUTION

Hi @jwang19 ,

 

Based on your data, there is only one line of data that also satisfies Manager=A , Customer=xxxxx /zzzzz , MeetingDate=4/1/2023, due to the fact that measure is dynamic value that change based on context. So if you want to show only the number of Customer selected in the slicer, you can create a card visual object or place only this metric in the table and the other slicers don't affect the measure, so you also need to edit the interaction.

vtangjiemsft_0-1691999181775.png

 

vtangjiemsft_1-1691999214753.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Hi @jwang19 ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure. 

Count of Selected Customer = CALCULATE(DISTINCTCOUNT('Customer_Visit_Plan'[Customer]),ALLSELECTED('Customer_Visit_Plan'[Customer]))

(2) Then the result is as follows.

vtangjiemsft_0-1691977270183.png

 

Unfortunately the pbix you provided I do not have access to. If this doesn't help, please provide the pbix file that can be accessed. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. s

Hi @v-tangjie-msft,

 

Thanks for the response, but it's not working in my file.

jwang19_1-1691978175907.png

 

 

Please see attached my access link: https://joycewang1003.notion.site/Demo-Questions-54a2d9b721a74bba936fc968217e31a7?pvs=4

If it's still not working, my demo table is like this without any relationship:

jwang19_0-1691978064370.png

 

Thanks again for your help!

Hi @jwang19 ,

 

Based on your data, there is only one line of data that also satisfies Manager=A , Customer=xxxxx /zzzzz , MeetingDate=4/1/2023, due to the fact that measure is dynamic value that change based on context. So if you want to show only the number of Customer selected in the slicer, you can create a card visual object or place only this metric in the table and the other slicers don't affect the measure, so you also need to edit the interaction.

vtangjiemsft_0-1691999181775.png

 

vtangjiemsft_1-1691999214753.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

Thanks, perhaps it's the correct solution for this case.


Unfortunately it couldn't fix my question to calculate the selected costumers considering all context, so I reopen another new question to describe the whole report I'd like to make.

Pls let me know if you have any ideas on it: Blank option in Single-select slicer with other op... - Microsoft Fabric Community

Thanks!!

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors