Forum Discussion
How to generate custom legends for Donuts?
- 3 years ago
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.
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.
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!
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 |
| 20 | 0 | 4 | 0 |
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.
Thank you!
- v-jingzhang3 years ago
Community Support
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.
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.
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!