Short answer: conditional formatting sets a colour, an icon or a bar from the data. Anywhere you see the fx button in the format pane (column colours, font colours, backgrounds, titles, borders), you can pick one of three format styles: Gradient (a colour scale between a minimum and maximum), Rules ("if the value is below 0, red") or Field value (a measure returns the colour itself). Tables and matrices add data bars, icons and web URLs. A measure can return a hex colour, or a theme colour name such as good, bad or neutral.
A table of 30 numbers takes a minute to read. The same table with the three red cells that matter takes a second. Colour used for one message per visual turns a report into an alert; colour everywhere turns it into noise.
The short video below shows how to pick colours everyone can read, including people with colour blindness, and why colour should never carry the meaning alone.
What can be formatted?
| Element | Options |
|---|---|
| Table and matrix cells | background colour, font colour, data bars, icons, web URL |
| Chart columns, bars, lines, markers | colour (fx) |
| Card callout and reference labels | font colour, background |
| Visual title, subtitle, borders | colour, and the title text itself (field value) |
| Shapes, buttons, text | fill, text colour |
Which format style should you use?
| Style | How it decides | Use for |
|---|---|---|
| Gradient | a colour scale from the lowest to the highest value, optional centre | heatmaps, "more is darker" |
| Rules | ranges of values or percentages map to colours | thresholds: below target, near, above |
| Field value | a measure or column returns the colour | any logic you can write in DAX |
Microsoft's column chart example shows all three: a gradient on sales variance (red for low, blue for high), rules on a status measure, and a field value measure Color status = IF([This Year Sales] > 2000000, "#200AE8", "#F00938").
How do you write a colour measure?
Return a hex code, a colour name, or a theme colour name. Theme names keep the report consistent when the theme changes:
Target Status Colour =
VAR Attainment = DIVIDE ( [Revenue], [Revenue Target] )
RETURN
SWITCH (
TRUE (),
ISBLANK ( Attainment ), BLANK (),
Attainment >= 1, "good",
Attainment >= 0.9, "neutral",
"bad"
)With Field value, Power BI uses the current theme's good, neutral and bad colours. Returning BLANK() leaves the default colour. For hex codes, use "#1A9E75"-style strings.
How do data bars and icons work?
In a table or matrix, open the arrow next to a measure in the well, Conditional formatting:
- Data bars: a bar in the cell, scaled from the lowest to the highest value (or fixed minimum and maximum), with separate colours for positive and negative, and Show bar only to hide the number.
- Icons: arrows, traffic lights or shapes by rules, placed left or right of the value; or a measure that returns an icon name.
- Apply to: values only, values and totals, or totals only.
A rule-based icon for change against last year: up arrow above +2%, sideways between -2% and +2%, down arrow below -2%.
What goes wrong?
- Colour on everything. Formatting every column means none stands out; format the one column that carries the message.
- Red and green only. About one in twelve men has trouble telling red from green; add icons or use blue and orange.
- Gradients across totals. A total row in a gradient is the darkest cell and dominates; apply to values only.
- Hex codes everywhere. A rebrand means editing every measure; return theme names (good, bad, neutral) or keep colours in one measure.
- Blank cells coloured as zero. A gradient may treat blanks as the minimum; decide in the dialog how to format blanks.
Where can you check this?
- Microsoft Learn: Apply conditional formatting in tables and matrixes
- Microsoft Learn: Create and use column charts in Power BI (conditional formatting)
- Microsoft Learn: Use report themes in Power BI (theme colours in DAX)
Where do you start?
Write one status measure that returns good, neutral or bad, and use it with Field value on the visuals where the status matters. Report themes set what good, neutral and bad look like.