Stop 11 · Visualization & Report DesignTopics · 8/12

Conditional Formatting in Visuals

Part of the Power BI Roadmap

In short

In a table of 200 numbers, nobody finds the problem stores by reading. Conditional formatting paints the warning signs on the numbers, so the eye goes straight to them.

Conditional formatting changes colours, icons or data bars based on values or rules, so important numbers stand out without the reader searching.

The jaadu directs traffic at a junction, holding up a glowing paddle while a row of small toy cars waits in a neat line.

Think of it like this

The traffic signal

At a Bengaluru junction you don't read a sign saying "please stop now". You see red and stop. Conditional formatting turns rules into signals: cells below target glow amber or red, top performers get a green tick, and long bars show size at a glance.

Watch it happen

Store achievement vs target

Andheri 112%
0
Baner 96%
1
Indiranagar 78%
2
Salt Lake 104%
3
T Nagar 88%
4

1/5Five stores and their sales as a percentage of target.

The big ideas

What you need to know

Background and font colour

Colour cells by a scale, by rules, or by a field value measure that returns a colour code.

Data bars

Tiny bars inside the cells show relative size without a separate chart.

Icons

Arrows, ticks and flags work for people who can't tell red from green.

Field value measures

A DAX measure returning a hex colour gives you full control and can be reused across visuals.

See it in code

Walk through the code

dax
1Target Achieved % = DIVIDE ( [Total Sales], [Target] )2 3Achievement Colour =4VAR Ratio = [Target Achieved %]5RETURN6    SWITCH (7        TRUE (),8        ISBLANK ( Ratio ), BLANK (),9        Ratio >= 1, "#1B8A5A",10        Ratio >= 0.9, "#D98E04",11        "#C0392B"12    )

1/4Sales as a share of target.

In Conditional formatting > Background color, choose Format style: Field value and pick Achievement Colour.

Save yourself the pain

Common mistakes

Oops

Colouring every column in a different gradient.

Do this instead

Format the one or two columns that drive decisions. Too much colour hides the signal.

Oops

Using only red and green to show good and bad.

Do this instead

About 1 in 12 men has some colour blindness. Add icons or use blue and orange.

Your mission

Make the problems pop

~20 min

Quick check

What should a measure return to be used as a Field value for background colour?

Go deeper

  1. 1Colour negative growth red and positive growth green in a matrix.
  2. 2Drive formatting from a DAX measure that returns a colour code.
  3. 3Use colour sparingly so it still draws attention.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge