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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Need to assign some counts of a specific column values in 4 levels of range for donut chart purpose

Hi everybody!
i'm new at Power BI and i need to know how to split a count of some values in a range of 4 levels to be displayed in a donut charts.
i'll try to be more clear: Donut example 

 

focus just to the legend PERC, i created  a column with those 4 value as a visual legend but now i need to count some values (based on their values, for example the count of the values between 0 and 5000 should be inserted into first group, and so on).
can you tell me how to do it?
Thanks a lot

3 ACCEPTED SOLUTIONS
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

These two articles explain how to do it.

https://www.daxpatterns.com/static-segmentation/

https://www.daxpatterns.com/dynamic-segmentation/

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

Hi  @Anonymous ,

 

Create a calculated column to count each group,similarly as below:

 

Count = CALCULATE(COUNTROWS('Table (2)'),ALLEXCEPT('Table (2)','Table (2)'[Grouping values]))

 

Then put the count column in  the field of legend,choose "expand all down one level in the hierarchy" ,see  below :

Annotation 2020-04-22 130320.png

And you will see:

Annotation 2020-04-22 130629.png

I made a sample .pbix file which you can refer to,pls click here.

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

View solution in original post

Hi @Anonymous ,

 

If you hope the total number appears in the center of donut,I have a workaround for:

1. Create a measure as below:

 

overall = COUNTROWS('Table')

 

2. Put the measure in a card visual:

Set : category->off, title >On,writing "Overall" in title field

Then select card and donut, click on "card"+ctrl +right click on donut,choose "group",as shown below:

Annotation 2020-04-23 085047.png

And you will see:

Annotation 2020-04-23 085223.png

 

I have modified the .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

These two articles explain how to do it.

https://www.daxpatterns.com/static-segmentation/

https://www.daxpatterns.com/dynamic-segmentation/

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Thanks!
I solved the first part, now i would ask how can i show the number of each count near the legend:
https://imgur.com/UYTqZEi

Hi  @Anonymous ,

 

Create a calculated column to count each group,similarly as below:

 

Count = CALCULATE(COUNTROWS('Table (2)'),ALLEXCEPT('Table (2)','Table (2)'[Grouping values]))

 

Then put the count column in  the field of legend,choose "expand all down one level in the hierarchy" ,see  below :

Annotation 2020-04-22 130320.png

And you will see:

Annotation 2020-04-22 130629.png

I made a sample .pbix file which you can refer to,pls click here.

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

Anonymous
Not applicable

Amazing! Thanks a lot @v-kelly-msft !
May i ask you just a couple of minor things before closing the request?


1) Is there a way to outdistance the number of count from the range value? Maybe with a -? Because with just a space character it's a bit chaotic. SOLVED

2) Is there a way to show the overall(the total sum of all count) inside the donut? i'll show a picture with these ideas

donut 

 

Hi @Anonymous ,

 

If you hope the total number appears in the center of donut,I have a workaround for:

1. Create a measure as below:

 

overall = COUNTROWS('Table')

 

2. Put the measure in a card visual:

Set : category->off, title >On,writing "Overall" in title field

Then select card and donut, click on "card"+ctrl +right click on donut,choose "group",as shown below:

Annotation 2020-04-23 085047.png

And you will see:

Annotation 2020-04-23 085223.png

 

I have modified the .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.