Do you want to apply conditional formatting to a Power BI Pie chart? In this Power BI tutorial, we will see how to apply conditional formatting to a Pie chart slicer and data value in Power BI.
Here, we will cover the topics below:
- What is conditional formatting in Power BI?
- Power BI Pie Chart Conditional Formatting
- Power BI pie chart data value conditional formatting based on Color Scale.
- Power BI pie chart data value conditional formatting based on Rules.
What is Condition formatting in Power BI?
Conditional formatting in Power BI is a feature that allows you to dynamically format visuals (such as tables, matrices, charts, and so on) based on conditions or rules. It allows you to visually highlight key data points, and trends in your reports, making it easier for users to find and analyze insights.
To apply conditional formatting, there are 3 ways:
- Rule: Rules allow you to define specific conditions for formatting individual data points within a visual
- Color scale/Gradient: Color scales in conditional formatting apply a gradient of colors to visual elements based on the relative values within a range.
- Field value: Field value formatting allows you to apply conditional formatting directly to the data values themselves within a visual.
Conditional Formatting Slices of a Power BI Pie Chart
Here, we will see how to format the slices of a Pie chart. Unfortunately, in Power BI, the Pie chart lacks a conditional formatting option to change slice colors based on conditions.
However, I’ll guide you on how to change the colors of Power BI pie chart slices.
For example, we will use the below Financial excel sheet to create a Pie chart.

We will display the sales based on the segment in the Power BI Pie chart. As a pie chart, we cannot format the slices, so here we will convert the Pie chart to a bar chart, or you can directly create the bar chart. Then, we will apply the conditional formatting to it and convert it to a Pie chart.
Now, let’s see how we can apply the conditional formatting to slices of the Power BI Pie chart.
- Open Power BI Desktop, and then click on Get data -> select Excel Workbook.

Then select the Excel sheet from your local system; in the Navigator window, select the table and click on the Load button.

- Select the Stacked bar chart from the visualization pane to create the bar chart.

- To show the sales based on segment, drag and drop the Sales and Segment columns to the X and Y axis, respectively.

- Next, click on the Format pane, then expand the Bar section.
- Click on the fx in the color section.

- It will open the Conditional Formatting window. Here, select the Format style as a Gradient.
- Select the Sales field in ‘What field should we base this on‘, select Sum as Summarization.
- Next, ‘How should we format empty values‘ as ‘As zero‘.
- Then, in Minimum value, select Custom from the dropdown and enter the value as 10,000,000. Select the color.
- For the Maximum value select Custom from the dropdown and enter the value as 25,000,000
- Also, you can enable the middle value by checking the box of Add a middle color. Then click on Ok

Now you can see the color formatting is applied to the bar chart in Power BI.

- To convert the bar chart to a pie chart, select the Pie chart from the visualization pane.

This is how to apply conditional formatting to the slices of a Pie Chart in Power BI.
Power BI pie chart conditional formatting based on gradient
Here, we will see how to apply conditional formatting on the Power BI Pie chart based on gradient.
For example, we will use the Financial Excel sheet data and will create a pie chart in Power BI Desktop, which shows information related to Sales based on Segment.

Based on the sales value, we will adjust the color gradient of the ‘Sum of Sales’ value or data label font color in the pie chart.
The gradient will be determined by three parameters: the lowest value, the middle value, and the highest value.
For example, suppose the minimum sales value is 10,000,000 and the maximum value is 25,000,000. In that case, the font color labels will transition from light yellow for lower sales to dark yellow for higher sales, with shades in between reflecting varying sales amounts.
To apply conditional formatting based on the Power BI pie chart gradient, follow the steps below.
- In Power BI Desktop, select the Pie chart from the canvas.
- Then click on the Format pane icon.

- Here expand the ‘Detail labels‘ section, expand the Values section.

- Now, change the Display units to Thousands. If you want to increase the font size of the Data labels.
- Then, in the Color section, click on the fx icon to apply conditional formatting.
- Now, the Conditional formatting window will open.

- Here, select the Format style as a Gradient.
- Select the Sales field in ‘What field should we base this on‘, select Sum as Summarization.
- Next, ‘How should we format empty values‘ as ‘As zero‘.
- Then, in Minimum value select Custom from the dropdown and enter the value as 10,000,000. And select the color.
- For the Maximum value select Custom from the dropdown and enter the value as 25,000,000
- Also, you can enable the middle value by checking the box of Add a middle color. Then click on Ok

- Now you can see that the data label font color changes in the Power BI Pie chart.

Power BI pie chart data value conditional formatting based on Rules
Here, we will see how to apply conditional formatting based on rules in the Power BI Pie chart.
We’ll implement conditional formatting rules for the font color of data labels in the Power BI Pie chart, based on the Sum of sales segmented by category.

Here, we will apply the condition formatting rule to change the data label font color in the Power BI Pie chart. The rule is:
- If the Total Sales amount is greater than 0 and less than 20000000, then the data label font color is light pink.
- Else if the Total Sales amount is greater than 20000000 and less than 1000000000, then the data label font color is dark pink.
Now let’s see how we can apply the rule to the data label font color in Pie chart.
- In Power BI Desktop, select the Pie chart from the canvas.
- Then click on the Format pane icon.

- Here expand the ‘Detail labels‘ section, expand the Values section.
- Then, click on the fx icon in the Color section to apply conditional formatting.

- Now, the Conditional formatting window will open.
- Here, select the Format style as a Rule.
- Select the Sales field in ‘What field should we base this on‘, and select Sum as Summarization.
- Next, If the value >0 [Number] and less than 20000000[Number], then the color is pink. Then click on the +New rule button.
- If the value >20000000 [Number] and less than 1000000000, then the color is dark pink
- Then click on Ok

Now, you can see data label color changes based on the rule provided.

Conclusion
In this Power BI tutorial, we saw what conditional formatting is. Also, we covered the topics below:
- Format the slices of a Pie Chart in Power BI
- Power BI pie chart data value conditional formatting based on Color Scale.
- Power BI pie chart data value conditional formatting based on Rules.
You may also like:

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.