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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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