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

How to generate custom legends for Donuts?

I have generated below donut visual. But it showing for No data fields also. I want to show legends only for available Donut slicec.

balajiratnala6_0-1671189324132.png

Please help me to do it.

1 ACCEPTED SOLUTION

Hi @balajiratnala6 

 

Here is a workaround you can try:

First in Power Query Editor, select all four columns and click on Unpivot Columns. Change column data types. Apply the change to Power BI Desktop. 

vjingzhang_0-1672306970784.png

 

Then create a Donut chart. Put Attribute column in legend and Value (Sum aggregation) in values. Then filter Sum of Value to show items when the value is greater than 0. 

vjingzhang_1-1672307177310.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

View solution in original post

5 REPLIES 5

@Mahesh0016 

No fields added to legend . If I am trying to add, visual meshing up,

balajiratnala6_0-1671262013429.png

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@Mahesh0016  Below is sample data

 

pass  unknownFailure     clientIssues    routingIssues
20040

 

Donut should visualize above 4 column values and as legend all column names displayed if all on Donut if values non-zero.

In below donut, only pass and clien issue have values and displayed on donut.

No values for unknownFailure and routingIssues So not displayed on donut but shown in legends. Also should not display in legends.

 

balajiratnala6_0-1671291300679.png

 

 Thank you!

Hi @balajiratnala6 

 

Here is a workaround you can try:

First in Power Query Editor, select all four columns and click on Unpivot Columns. Change column data types. Apply the change to Power BI Desktop. 

vjingzhang_0-1672306970784.png

 

Then create a Donut chart. Put Attribute column in legend and Value (Sum aggregation) in values. Then filter Sum of Value to show items when the value is greater than 0. 

vjingzhang_1-1672307177310.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

Mahesh0016
Super User
Super User

Hello @balajiratnala6 ,
Legeng Column uncheck show item with no data.


if it is helpful for you accepted as a solutions.
Thank you!

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.