05/02/2025
Hello and welcome back! In this blog post, I’ll introduce you to Power BI conditional formatting. I’ll walk you through its different types, use cases, and some helpful tips to make the most of it. By the end, you'll have a solid understanding of how to enhance your reports with dynamic formatting. So let's get started!
What is Conditional Formatting in PBI?
Conditional formatting in Power BI is a feature that allows you to dynamically change the appearance of visuals—such as tables, matrices, charts, and cards—based on specific conditions or rules. You can apply conditional formatting to fields like text, background color, font color, data bars, and icons to highlight key insights and improve data visualization.
The screenshot below shows where to find conditional formatting in Power BI Desktop while creating a table visual.
Power BI Conditional Formatting offers three format styles: Gradient, Rules, and Field Value. Let's dive in.
Configure Gradient format style in your visual
For this tutorial, I’m using the same dataset from my previous blog. Start by creating a table visual and adding all the columns. Now, let's apply the Gradient style conditional formatting. The Gradient style uses a color scale to represent data variations, where colors transition smoothly from one shade to another based on values, requiring a minimum, midpoint (optional), and maximum value. Below image guides you to apply it to SalesAmount column's background color in the table visual.
As you can see in the right image, the background color of the SalesAmount has changed. If desired, you can add a middle value for the gradient and define your own numeric range. Let's move onto rules format style.
Configure Rules format style in your visual
The Rules style applies specific formatting based on predefined conditions or thresholds, allowing you to set custom rules such as highlighting values above or below a certain number, categorizing data into different color codes, or emphasizing key insights based on business logic. Let's implement rule style for the backgroung color of SalesAmount column.
As seen in the images above, the background has changed based on a predefined rule. Try experimenting with font colors and data bars as well. Let's hop onto final format style in Conditional formatting.
Configure Field Value format style in your visual
The Field Value style dynamically assigns colors based on a separate column or measure, requiring the field to return a valid color name (e.g., "Red") or a HEX code (e.g., "#FF5733"), making it ideal for datasets with predefined color rules. This is my favourite format style in conditional formatting, It involves bit of DAX too!
I am going to change the background color of SalesAmount based on CustomerID. First you need to create a measure like below.
As shown in the image above, I have assigned a specific background color (HEX code) based on Customer ID. Next, add this measure to the background color conditional formatting of SalesAmount.
Personally, I think this is the coolest format style in Power BI conditional formatting! Try experimenting with different conditions in your measure—I’m sure you’ll create even more amazing visuals.
Tips for Effective Conditional Formatting in Power BI
Apply Formatting Dynamically – Use DAX measures to make formatting responsive to filters and slicers for a more interactive experience.
Avoid Overuse of Colors – Too many colors can make visuals confusing. Stick to a simple, meaningful color scheme. I mostly prefer clean pastel colors.
Choose the Right Format Style – Use Gradient for smooth transitions, Rules for specific thresholds, and Field Value for dynamic color assignments from a dataset.
We've now reached the end of this blog post—I hope you’ve learned the basics of conditional formatting in Power BI! So far, I’ve covered background color formatting, but I encourage you to explore other types, such as text, font color, data bars, and icons. If you want to learn more visit official MIcrosoft site here. Plus, there are plenty of blogs and videos available online—don’t limit yourself to one source, keep exploring!
As I always say, practice makes perfect! Keep experimenting and happy visualizing!