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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Igor_Reis_HG
Regular Visitor

Add count of values in a slicer visual

I have managed to create a slicer visual that not only shows the unique values of a column I want to filter but also the amount of times these values appear in the column, as shown in the picture below.

 

Igor_Reis_HG_0-1698079633067.png

 

But I'm having an issue where the value inside the parenthesis doesn't change when I filter the page with a slicer with date values.

When filtering the page with the month of september it should only show the amount of each value for that month.

 

To be able to reach the slicer visual above I:

- Manually inserted the unique values of the column I want to use for the slicer, using insert data from within Power Query

- Created a calculated column with the following DAX code:


´´´

ConcatenatedValue =
VAR ValueFromNewTable = 'New Table'[Status]
VAR CountOccurrences =
    CALCULATE(
      COUNTROWS('Original Table'),
      DISTINCT('Original Table'[Status]),
      'Original Table'[Status] = ValueFromNewTable
    )
RETURN
    ValueFromNewTable & " (" & CountOccurrences & ")"

´´´

- Created a blank slicer and inserted the calculated column that I created in it.

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

I don't think this feature is doable with PowerBI's existing slicer. The reason that the values won't change is that calculated columns and tables only change when the report is refreshed. But at the same time, we can't use measures in slicers. 

As a work around, you could try use a table / matrix with the status and measure for countOccurences, and turning on visual interactions for cross-filtering. 

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

I'm sorry to sound stupid but when I look at the new Microsoft List slicer  Ruthie09_1-1746724587429.png, these are the options I'm offered:

 

Ruthie09_0-1746724445726.png

None of which contain a Label field.

 

Ruthie09_2-1746724691163.png

 

Is there a different slicer I should be using.

Nope, not stupid. I assumed you were on the new tile slicer visual: 

idkwhatimdoing_0-1746726609524.png

If you wanted to use it on your list slicer, it gets more complicated and not something I've played around with yet.

Anonymous
Not applicable

What I'm hoping to have displayed in the slicer is something along these lines:

 

New (100)

On Hold (5)

Cancelled (3,489)

Closed (21,923)

etc. etc.

 

Where it is utilizing the Status field and the Incident Count = COUNT('table'[Incident Number]) measure (surrounded by parentheses).

 

I'm on Oct 2024 version.  How do I accomplish that?

Yes. As the Value in your slicer, use Status, but when you format the visual, turn the label on and add Incident Count to the label field. However, if you want paraenthesis around your numbers, you'll need to add a measure that is something like Incident Count_format = "("& 'Table'[Incident Count] & ")" as the label field instead.

vicky_
Super User
Super User

I don't think this feature is doable with PowerBI's existing slicer. The reason that the values won't change is that calculated columns and tables only change when the report is refreshed. But at the same time, we can't use measures in slicers. 

As a work around, you could try use a table / matrix with the status and measure for countOccurences, and turning on visual interactions for cross-filtering. 

Hi @vicky_ san and @Igor_Reis_HG San,

It is do able with new slicers visual in Power BI .Version: 2.126.927.0 64-bit (February, 2024).

I have attached the snippet of my dashboard.

In new slicers visual, we need to add field values for labels and they are interactive and dynamic.

PRANESHBALAJI_0-1709402064706.png

 

How did you calculate your measure that you used for the label? 

Anonymous
Not applicable

I would also like to know how you calculated it.

I believe I ended up doing it with just a basic measure of Count = COUNTROWS(Table) and then used that for the label. 

Thanks for sharing @PRANESHBALAJI . Quick question for you, what visualization are you using to create the box and whisker plot? Ive search a lot to try to find one and havent beena able to find a good one. It would be great if you could share the link. Thanks!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.