Report colours in Power BI: one theme for every visual

Set colours once in a report theme, not visual by visual. Pick a built-in theme on the Design ribbon or import a JSON file with dataColors, background and foreground, then choose theme colours in visuals so they follow any later change. Check contrast: WCAG AA asks 4.5:1 for normal text and 3:1 for graphics.

Analysts · ·

The problem

Every visual in the report has its own colours. Someone changes the palette and half the visuals keep the old one, a yellow series disappears on a white page, and the report looks like three people built it. This Pattern is for analysts who want to set colours once and be able to check that they read well.

What is generally available and what is not

  • Design ribbon for reports: generally available in Power BI Desktop in the September 2026 update, which also adds the Dark and Soft dark themes. In the Power BI service the Design ribbon needs “Try the new ribbon”, labelled preview on Learn.
  • Fluent 2 base theme: the visual defaults page presents it as the default base theme for new reports, with no preview label. The March 2026 update archive listed “modern visual defaults” as preview. Both are true at different dates. Check your own Desktop version.
  • Theme JSON and the Theme pane: documented without a preview label.
  • Checked 2026-11-29.

Steps

Three stacked layers: base theme, custom theme, and one visual's own formatting. An arrow shows that Reset to default sends a visual one layer down.

Where a colour comes from in a report.

  1. Start with a built-in theme. In Power BI Desktop open the Design ribbon and pick a theme in the Themes gallery. In the service select View, then Theme. The built-in themes include Bloom, Divergent, Frontier, Innovate, Tidal, Dark and Soft dark. Applying a built-in theme removes any customisation already added to the report.

  2. Adjust the current theme. On the Design ribbon select Customize theme. The Theme pane has Colors, Text, Visual properties, Page and Filter pane sections. The Colors section offers palettes such as Versa, Sunset, Accessible Default and Electric, and lets you edit data, structural, sentiment and divergent colours.

  3. Or write the theme as a file. Only name is required. This sample sets the series colours and the structural colours. It is a synthetic example and it was not imported into Power BI. Its JSON syntax was loaded with Python’s json module.

    {
        "name": "Sample warm",
        "dataColors": ["#1F6F8B", "#E8793A", "#B4308F", "#6B7A8F", "#F2C14E", "#2B1B2E"],
        "background": "#FFFFFF",
        "foreground": "#2B1B2E",
        "tableAccent": "#1F6F8B"
    }
    

    Save it as sample-theme.json, then use Import theme on the Design ribbon. Power BI checks the file against a JSON schema and reports unrecognised fields.

  4. Check the contrast before you import. Save this script as theme_contrast.py. It reads the theme file and computes the WCAG contrast ratio of each data colour and of the foreground against the background.

    import json, sys
    
    def lin(c):
        c = c / 255
        return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
    
    def luminance(hex_color):
        h = hex_color.lstrip("#")
        r, g, b = (int(h[i:i + 2], 16) for i in (0, 2, 4))
        return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b)
    
    def contrast(a, b):
        la, lb = luminance(a), luminance(b)
        hi, lo = max(la, lb), min(la, lb)
        return (hi + 0.05) / (lo + 0.05)
    
    theme = json.load(open(sys.argv[1]))
    bg = theme["background"]
    print(f"theme: {theme['name']}  background: {bg}")
    for color in theme["dataColors"]:
        ratio = contrast(color, bg)
        print(f"{color}  {ratio:5.2f}:1  {'ok (>= 3:1)' if ratio >= 3 else 'FAILS 3:1'}")
    fg = theme["foreground"]
    ratio = contrast(fg, bg)
    print(f"foreground {fg}  {ratio:5.2f}:1  {'ok (>= 4.5:1)' if ratio >= 4.5 else 'FAILS 4.5:1'}")
    

    Run python3 -I theme_contrast.py sample-theme.json. The recorded output is below: two of the six data colours fail the 3:1 threshold for graphics on white.

    Terminal output of the contrast script: orange E8793A at 2.91 to 1 and yellow F2C14E at 1.68 to 1 fail 3 to 1.

    Real output of the script on the sample theme, 2026-11-29.

    The script compares each colour with the page background only. WCAG 1.4.11 speaks of adjacent colours, so two touching series also need checking against each other.

  5. Use theme colours in the visuals. In a colour picker choose from the theme colours. Visuals then follow a later theme change. “More colors” fixes a colour and the visual no longer follows.

  6. Drive status colours from the theme. In conditional formatting with the Field value style, return a theme colour name from a measure. From Microsoft’s page:

    Status Color =
    VAR CurrentStatus = [Status Score]
    RETURN
        SWITCH(
            TRUE(),
            CurrentStatus >= 80, "good",
            CurrentStatus >= 50, "neutral",
            "bad"
        )
    
  7. Reset what you overrode. Reset to default on a visual returns it to the theme. It also removes conditional formatting rules, actions on buttons and images, and other data-bound items on that visual, so use the section-level reset when you only want to clear a colour.

The project

No downloadable project for this Pattern. The theme file and the script above are complete as shown.

Copy this prompt

To turn a brand palette into a Power BI theme, paste this into your AI assistant and fill in your hex colours. Ask for a theme JSON file and a list of colours that need adjusting. You can then import the file in Power BI Desktop and check the proposed changes.

Write a Power BI report theme JSON file named <theme name> with <number> dataColors
starting from the brand colours <hex list>, background <hex>, foreground <hex> and
good, neutral and bad colours. Then list which colours fail a 3:1 contrast ratio on
the background and 4.5:1 for the foreground, and replace only the failing ones with
the closest passing colour. Use only properties from Microsoft's report theme schema.

Check the failing colours with the script above or another calculator, and import the file in Desktop to confirm that no field is rejected.

Test result

The contrast script found two sample colours below 3:1 on white. The image identifies them. Run the same check with your own palette.

Limits

  • The contrast script compares colours with the page background. It does not check adjacent series colours against each other, text on coloured fills, or colour-blind distinguishability.
  • A contrast ratio is a threshold: 2.999:1 fails 3:1.
  • Applying a built-in theme or importing a custom theme removes the customisations already added to the report.
  • You cannot add conditional formatting rules to a custom theme. Apply them to visuals after applying the theme.
  • In the Power BI service, theme commands on the Design ribbon exist only in Desktop. Use the Theme pane to import, export or customise a theme there.

Sources

Author

Rodrigo Lombana Reina, data engineer. Personal opinions. Checked against the documentation on 2026-11-29.

Questions

How do I change the colours of a whole Power BI report?

Apply a report theme. In Power BI Desktop use the Design ribbon and pick a theme from the Themes gallery, or select Customize theme to set colours, text and visual defaults. In the Power BI service select View, then Theme. Visuals you formatted by hand keep their changes until you reset them to default.

How do I create a custom Power BI theme file?

Write a JSON file. Only the name property is required; add dataColors for the series colours, background and foreground for structural colours, and good, neutral and bad for status colours. Then use Import theme on the Design ribbon. Power BI validates the file against a schema and shows an error for unrecognised fields.

Why did my visual not change colour when I switched theme?

Because its colour is not a theme colour. If you pick a theme colour from the palette, the visual follows later theme changes. If you pick More colors, it stays fixed. Reset to default on the visual's formatting section returns it to the theme, but also removes conditional formatting rules and button actions on that visual.

How do I use theme colours in conditional formatting?

Use the Field value format style and return a theme colour name from a DAX measure, such as good, neutral or bad, instead of a hexadecimal code. Colours then update automatically when you change the theme. Microsoft documents this for measures, report measures on a live connection and visual calculations.

What contrast should report colours have?

WCAG 2.2 level AA asks for a contrast ratio of at least 4.5:1 for normal text, 3:1 for large text, and 3:1 for graphical objects and interface components against adjacent colours. In the recorded check of a six-colour sample theme on white, two data colours failed 3:1: orange #E8793A at 2.91:1 and yellow #F2C14E at 1.68:1.

Is the Design ribbon generally available?

In Power BI Desktop, yes: the September 2026 update lists the Design ribbon for reports as generally available, with new Dark and Soft dark themes on the Versa palette. In the Power BI service the Design ribbon appears in editing mode when you turn on Try the new ribbon, which Learn labels as preview.

What are the Dark and Soft dark report themes for?

They give a dark report canvas while you design, using the Versa colour palette and styling close to the Fluent 2 base theme. Microsoft advises selecting Reset to default before you publish, to return the report to the default light theme. They are built-in themes in the Themes gallery on the Design ribbon.

Portrait of Rodrigo Lombana Reina

Rodrigo Lombana Reina, data engineer. Data problems solved, step by step.

About Rodrigo · The opinions and texts on this site are my own.

My LinkedIn profile