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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
meskens
Frequent Visitor

Calculate how many results are within a range

Hi all,

 

I want to count how many people are within a range based on the slicer selection and put this in a pie chart

The range is   0

                     >0 and <= 3,5

                      >3,5

I've calculated the average for each person and it changes when selecting 1 or multiple months but how can I count this.

I attached a small sample. Let me know if my questions is not clear enough.

 

 

https://www.dropbox.com/scl/fi/lwrtdaug9xq0be101jn0m/Ziekteverzuim_2.pbix?rlkey=efg5ajnid06ae42renb6... 

1 ACCEPTED SOLUTION
Gengar
Resolver I
Resolver I

Hi @meskens ,

 

First create a new table:

Gengar_0-1691670340934.png

Then apply this:

Count Values = 
var _a = SUMMARIZE('sheet',sheet[Naam/voornaam],"Percentage",[ziekteverzuimpercentage])
return 
SWITCH(SELECTEDVALUE('Table'[Value]),
"0",COUNTX(FILTER(_a,[Percentage]=0),[Naam/voornaam]),
"0-3.5",COUNTX(FILTER(_a,[Percentage]>0&&[Percentage]<=0.035),[Naam/voornaam]),
"over 3.5",COUNTX(FILTER(_a,[Percentage]>0.035),[Naam/voornaam]))

Output:

Gengar_1-1691670903788.png

Ziekteverzuim_2.pbix

 

Best Regards,

Gengar

 

View solution in original post

2 REPLIES 2
meskens
Frequent Visitor

Thanks Gengar, this works perfectly!

Gengar
Resolver I
Resolver I

Hi @meskens ,

 

First create a new table:

Gengar_0-1691670340934.png

Then apply this:

Count Values = 
var _a = SUMMARIZE('sheet',sheet[Naam/voornaam],"Percentage",[ziekteverzuimpercentage])
return 
SWITCH(SELECTEDVALUE('Table'[Value]),
"0",COUNTX(FILTER(_a,[Percentage]=0),[Naam/voornaam]),
"0-3.5",COUNTX(FILTER(_a,[Percentage]>0&&[Percentage]<=0.035),[Naam/voornaam]),
"over 3.5",COUNTX(FILTER(_a,[Percentage]>0.035),[Naam/voornaam]))

Output:

Gengar_1-1691670903788.png

Ziekteverzuim_2.pbix

 

Best Regards,

Gengar

 

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.

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.