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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
fabio7xavier
Frequent Visitor

Count of occurences to use on slicer

I have a table with two columns, one with a name and another with a value (1 or 0).

I want to count the number of occurences of the value 1 to each name (that could be duplicate).

 

For example, I have this table

NameValue
A10
A11
A11
A20
A20
A31
A31
A40
A41

 

And I want to get something like this

 

NameValueOccurences
A102
A112
A112
A200
A200
A311
A311
A401
A411

 

My goal is to use the result/calculated column as a slicer, with the number of occurences of 1's as options, to filter list of names.

print help.jpg

 

I already created this DAX measure to do it but i can't use it as a slicer

rank = CALCULATE(COUNT(Table[Value]);FILTER(Table;Table[Value] = 1)).

 

Any suggest how can I work around this problem?

 

Thank you in advice!

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You don't need any measure for this. See the attached file.

 

Best

D

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

You don't need any measure for this. See the attached file.

 

Best

D

az38
Community Champion
Community Champion

Hi @fabio7xavier 

try a measure

Occurences = CALCULATE(COUNTROWS(Table); ALLEXCEPT(Table; Table[Name]); Table[Value]=1)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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