Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
 
					
				
		
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
Solved! Go to Solution.
Hi @Anonymous
These two articles explain how to do it.
https://www.daxpatterns.com/static-segmentation/
https://www.daxpatterns.com/dynamic-segmentation/
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 :
And you will see:
I made a sample .pbix file which you can refer to,pls click here.
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:
And you will see:
I have modified the .pbix file,pls click here.
Hi @Anonymous
These two articles explain how to do it.
https://www.daxpatterns.com/static-segmentation/
https://www.daxpatterns.com/dynamic-segmentation/
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 :
And you will see:
I made a sample .pbix file which you can refer to,pls click here.
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
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:
And you will see:
I have modified the .pbix file,pls click here.
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 87 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |