Power BI Pie Chart Conditional Formatting [Useful Scenarios]

This Power BI tutorial will help you work with conditional formatting in a Power BI Pie chart.

Recently, I was working with a Power BI Pie chart where I needed to change the slice color so that it would attract the user.

Unfortunately, the Power BI Pie chart has one drawback. We can not find any conditional formatting option because it is unavailable in the Power BI Pie chart.

Here, I will explain to one another how to apply conditional formatting and change the pie chart slice to different colors.

Also, we will discuss how to apply the conditional formatting in a Power BI Pie chart using DAX.

Power BI Pie Chart Conditional Formatting

The first image displays a Power BI Pie chart with default slice colors. I want to change the Pie chart slice color with conditions.

After applying the conditional formatting, the Pie chart will display with color slicers, as shown in the second image.

Power BI Pie Chart Conditional Formatting

How to Apply Conditional Formatting in Power BI Pie Chart

I will tell you how to apply conditional formatting in the Power BI Pie chart. As I told you, we have other ways to apply conditional formatting in the Power BI Pie charts, i.e., using the Power BI Bar chart.

Follow the instructions below to apply conditional formatting in the Power BI Pie chart:

  1. Create a bar chart in Power BI.
  2. Apply conditional formatting to the bar chart in Power BI.
  3. Change the bar chart to a pie chart in Power BI.

Create a bar chart in Power BI

I have a SharePoint list (Amazongo) that contains below columns with various data types:

ColumnsData Types
Order DateDate and time
Customer NameSingle line of text
SateSingle line of text
Product NameSingle line of text
CategorySingle line of text
Sub-CategorySingle line of text
SalesCurrency
ProfitCurrency
Power Bi Pie chart color based on conditional formatting

1. Open Power BI Desktop and load the data set. Then, in the Data pane, you can see your data set.

Conditional Coloring on power BI Pie Chart based on value

1. Under the Visualizations pane, click the Stacked column chart. Then, drag the Sub-Category into the X-axis field and Profit into the Y-axis field.

conditional formatting in Power BI pie chart

Apply Conditional Formatting to the Bar Chart in Power BI

1. In the Visualizations pane, click on the Format your visual ->click Columns ->click fx. Check out the screenshot below.

power bi pie chart conditional formatting

2. Then, the Color – Categories dialog box opens. In this box, select Format style -> Rules and What field should we base this on? -> Sales.

pie chart conditional formatting in power BI

3. Then, choose a color from the highlight box dropdown below. Then click OK.

Power BI conditional formatting pie chart not available

4. Finally, conditional formatting is applied in the Stacked column chart.

power bi pie chart gradient color

Change the Bar chart to a Pie chart in Power BI

1. Select the Stacked column chart -> under the Visualizations pane, and click Pie chart.

conditional formatting pie chart not available in Power BI

2. The Power BI Pie chart will last appear with the conditional formatting below.

power bi pie chart data color conditional formatting

Now, our Power BI Pie chart has conditional formatting.

Power BI Pie Chart Conditional Coloring Based on the Rules

Power BI Pie chart conditional coloring based on the rules means you can set up rules to automatically change the colors of different pie slices based on their values.

Power BI Pie Chart Conditional Coloring Based on the Rules

We can see the pie chart was formatted conditionally on Power BI. Apart from that, we can also format the pie chart by rules. To do this, follow the below steps.

1. Under the Visualizations pane, click the Stacked column chart. Then, drag the Sub-Category into the X-axis field and Profit into the Y-axis field.

conditional formatting in Power BI pie chart

2. Under the Visualizations panel, click Format your visual -> select Visual -> Expand Columns -> click fx.

power bi pie chart conditional formatting

3. Then, the Color – Categories dialog box opens. In this box, select Format style -> Rules and What field should we base this on? -> Profit. Next, add some Rules using the + New rule. After that, click OK.

conditional formatting missing in power bi pie chart

4. Finally, conditional formatting is applied in the Stacked column chart based on rules.

conditional formatting not present in the power bi pie chart

5. Select the column chart, then click the pie chart in the Visualizations panel. Then, the Power BI Pie visual looks like the screenshot below.

conditional format Pie chart power bi

This way, we can format our pie chart based on the rules in Power BI Desktop.

Power BI Pie Chart Conditional Formatting Using DAX

Next, we will see how to apply conditional formatting in the Power BI Pie chart using DAX.

After applying the conditional formatting in the Power BI Pie chart, the Pie chart looks like this:

Power BI Pie Chart Conditional Formatting Using DAX

First, we need to create a measure to do this by following the below steps:

1. Under the Home tab, click on the New measure.

Power Bi Pie chart conditional formatting in DAX

2. In the Formula bar, put below the DAX expression. Then click commit.

Total Profit = SUM(Amazongo[Profit])
Power BI Pie Chart Conditional Formatting using DAX

3. I create another measure. Then, in the Formula bar, put it below the DAX expression. Then click commit.

Conditional Formatting = IF([Total Sales] >= 150,"Green","Red")
Pie chart Conditional Formatting in Power BI using DAX

4. Under the Visualizations pane, click the Stacked column chart. Then, drag the Sub-Category into the X-axis field and Profit into the Y-axis field.

conditional formatting in Power BI pie chart

5. In the Visualizations pane, click on the Format your visual ->click Columns ->click fx. Check out the screenshot below.

power bi pie chart conditional formatting

6. Then, the Color – Categories dialog box opens. In this box, select Format style -> Find value. Then, select What field should we base this on? -> Conditional Formatting. Then click OK.

How to apply conditional formatting to a Pie chart using DAX in Power BI

7. Select the Stacked column chart -> under the Visualizations pane, and click Pie chart.

power bi pie chart different colors based on value using DAX

8. Then you see the Pie chart conditional formatting applied.

How to Apply Conditional Formatting in the Power BI Pie Chart using DAX

You can apply conditional formatting in the Power BI Pie Chart using DAX.

Conclusion

I hope you can follow the above steps and create a pie chart in conditional Format in Power BI.

This tutorial taught us how to apply conditional formatting in a Power BI Pie chart using a gradient and Pie chart conditional format based on Rules.

Additionally, I explained how to apply the Power BI Pie chart conditional formatting using DAX.

Furthermore, you may like some more Power BI tutorials: