Power BI 3 min

Power BI: Apply dynamic colour coding

Short answer

With dynamic colour coding in Power BI you let colours automatically adjust based on data values. Via conditional formatting you set values below a threshold to colour red, moderate values orange, and good values green. For more complex logic, use a DAX measure that returns a colour code. This way you recognise trends and deviations at a glance without having to read the data.

A good dashboard tells a story without you having to search for long. With dynamic colour coding in Power BI you make your visualisations immediately more insightful and appealing.

A good dashboard tells a story without you having to search for long. With dynamic colour coding in Power BI you make your visualisations immediately more insightful and appealing. In this article you’ll learn how to let colours automatically adjust based on data values, helping you quickly recognise trends and deviations. This is essential for BI teams that want to optimise dashboards for quick decision-making.

What you need

  • A Power BI report with a table or matrix visualisation

  • A measure or column on which you want to base the colour (for example revenue, profit, or score)

  • Basic knowledge of using conditional formatting in Power BI

Step 1: Select the visualisation and open conditional formatting

Choose the visualisation in your Power BI report where you want to apply dynamic colour coding, for example a table or matrix. Go to the Visualizations pane and click the arrow next to the field whose colour you want to adjust. Then choose Conditional formatting and then Background colour or Font colour, depending on what you want to change.

Step 2: Set the rules for dynamic colour coding

In the conditional formatting window, choose Rules. Here you can link colour values to data ranges. For example: set values below 50 to colour red, between 50 and 80 orange, and above 80 green. This makes deviations and performance immediately visible. Fill in the minimum and maximum values and choose the desired colours. Click OK to apply the settings.

Step 3: Use DAX for advanced colour coding

For more complex scenarios you can create a DAX measure that returns a colour code based on your logic. For example:

ColorCode = 
SWITCH(
    TRUE(),
    [Revenue] < 50000, "Red",
    [Revenue] < 100000, "Orange",
    "Green"
)

Then use this measure in the conditional formatting by choosing Format by field value. This allows you to dynamically adjust colours based on your own rules.

Tips & common mistakes

  • Tip: Use contrasting colours for clarity, but avoid overly bright combinations that are tiring on the eyes.

  • Mistake: Using too many colour variations can be confusing; limit yourself to 3-4 colours per visualisation.

  • Tip: Always test your colour settings on different screens and devices to ensure consistency.

Example: Colour coding for sales performance

Suppose you have a table with monthly sales figures. With dynamic colour coding you mark months with low revenue red, average revenue orange, and high revenue green. This allows management to see at a glance which months need extra attention. This significantly increases the effectiveness of your dashboard.

Conclusion

With dynamic colour coding in Power BI you make dashboards not only visually more appealing, but also more functional. Try applying this technique directly in your reports and experience the difference in insight and usability. You can set all of this up easily directly in Power BI Desktop or the online environment.

Our tip: Use contrasting colours for clarity, but avoid overly bright combinations that are tiring on the eyes.

Frequently asked questions

How do I set up dynamic colour coding via conditional formatting?

Select the visual in your report and go to the 'Visualizations' pane. Click the arrow next to the field whose colour you want to adjust and choose 'Conditional formatting'. Select 'Background colour' or 'Font colour'. In the window, choose 'Rules' and set colour values for specific data ranges, for example red below 50, orange between 50 and 80, and green above 80. Click 'OK' to apply the formatting.

How do I use DAX for advanced colour coding in Power BI?

Create a DAX measure that returns a colour code as text based on your logic, for example via the SWITCH function. Use TRUE() as the first parameter and then define the conditions and corresponding colour values such as 'Red', 'Orange', or 'Green'. Link this measure to the conditional formatting by choosing 'Format by field value'. This allows you to dynamically adjust colours based on complex business rules that cannot be expressed with simple threshold values.

What common mistakes should I avoid with dynamic colour coding?

A common mistake is using too many colour variations in one visualisation. Limit yourself to a maximum of three to four colours per visual to prevent confusion. Also ensure sufficient contrast: too light shades are difficult to read on screens with low brightness. Test your colour settings on different screens and devices to ensure consistency. Also take colour blindness into account by not relying exclusively on red and green.

Want a dashboard or automation built for you?

Stuurboard BI builds custom Power BI dashboards and workflow automations. Pragmatic, fast, and without the fuss.