How to Use Conditional Formatting Visual in Power BI
In Power BI, use
conditional formatting to change visual elements like colors based on data values. You can apply it by selecting a visual, opening the Format pane, and enabling conditional formatting options such as color scales or rules for fields like background or font color.Syntax
Conditional formatting in Power BI is applied through the visual's Format pane. You select the field you want to format, then choose the formatting type such as Background color, Font color, or Data bars. You can set rules or color scales based on numeric or categorical data.
Key parts:
Field: The data column to format.Format type: Background color, font color, or data bars.Rules or color scale: Define how colors change based on values.
text
1. Select visual in Power BI report. 2. Open Format pane (paint roller icon). 3. Find the field to format (e.g., Values). 4. Click the dropdown arrow next to the field. 5. Choose Conditional formatting > Background color (or Font color). 6. Select Format style: Color scale or Rules. 7. Set colors and value ranges. 8. Click OK to apply.
Example
This example shows how to apply background color conditional formatting to a sales amount column. Values below 500 are red, between 500 and 1000 are yellow, and above 1000 are green.
text
1. Create a table visual with columns: Product, SalesAmount. 2. Select the table visual. 3. In the Fields pane, click the dropdown next to SalesAmount. 4. Choose Conditional formatting > Background color. 5. Select Format style: Rules. 6. Add rules: - If value is less than 500, color = red (#FF0000) - If value is between 500 and 1000, color = yellow (#FFFF00) - If value is greater than 1000, color = green (#00FF00) 7. Click OK. The SalesAmount cells will now show colors based on these rules.
Output
Table visual where SalesAmount cells are colored red, yellow, or green based on value ranges.
Common Pitfalls
- Not selecting the correct field for conditional formatting can cause no effect.
- Using incompatible data types (e.g., text for color scale) will disable options.
- For rules, overlapping or missing ranges can cause unexpected colors.
- Conditional formatting applies only to supported visuals and fields.
Always preview your formatting to ensure it matches your expectations.
text
Wrong way: - Applying color scale to a text field (no effect). Right way: - Apply color scale only to numeric fields like SalesAmount.
Quick Reference
| Step | Action | Notes |
|---|---|---|
| 1 | Select visual | Choose the visual you want to format |
| 2 | Open Format pane | Click paint roller icon |
| 3 | Find field dropdown | Next to the field to format |
| 4 | Choose Conditional formatting | Select Background or Font color |
| 5 | Pick Format style | Color scale or Rules |
| 6 | Set colors and ranges | Define how colors apply to values |
| 7 | Apply | Click OK to see changes |
Key Takeaways
Conditional formatting in Power BI changes visual colors based on data values.
Use the Format pane and field dropdown to access conditional formatting options.
Choose between color scales or rules to define how colors apply.
Apply formatting only to compatible fields and visuals for best results.
Preview your formatting to avoid overlapping or missing color ranges.