Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Need help on pie chart

I need help regarding Pie chart and table visual in Power BI.  I have a 5 device utilization data for last 6 months at daily level. Now the requirement is to create a pie chart and show the colors o...
  • Anonymous's avatar
    Anonymous
    1 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.