Forum Discussion
Need help on pie chart
- Anonymous1 year ago
Thanks for the reply from Kedar_Pande and pcoley , your replies are all fantastic! please allow me to provide some additional insights
Hi Anonymous ,
In Power BI, slice colours for pie charts do not currently support direct conditional formatting. However, you could achieve a similar effect with some workarounds.
1. Create a measure to calculate the average of each device.
AverageUtilization = AVERAGEX( SUMMARIZE( 'Table', 'Table'[Device], 'Table'[Month], "AvgUtilization", AVERAGE('Table'[Utilization]) ), [AvgUtilization] )2. Create a measure to determine the colour of each slice.
Device color = SWITCH( TRUE(), 'Table'[AverageProduction] < 50, "green", 'Table'[AverageProduction] >50 && 'Table'[AverageProduction] < 80, "grey", "Red" )3. Apply this colour measure in a bar chart or table.
4. Convert a bar chart or table to a pie chart. When I select green from the pie chart, I can see a list of devices belonging to the green category in the table visual object
Although pie charts themselves do not support conditional formatting, you can achieve a similar effect indirectly through this method.
Please refer to Power BI: Conditional formatting the Pie Visual - Microsoft Fabric Community
Could you please provide example data or sample files here if you have any confused? We could offer you more help if we have information in detail. There is sensitive data that can be removed in advance. How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.
Best regards,
Lucy Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
As I know, you cannot dynamically format category colors in a pie chart.
But you can dynamically format its labels.
If you have any more information please share we us, so we can try to help solving your requirement.
Please be precise of the average you want to handle: what do you mean by " basis of averge utilization of the devices at month level"? Are you planning to have 30 slices in a piechart(5 devices x 6months) or do you want to show one average (the Average of the 6-Month-Averages utilization) for each device? Do you have any column in a dimension table with dates (and a month-yy column on it)? Can you share the pbix?
I Hope this help, if so please mark it as solution. kudos are welcome😀