Turn a picture's style into a Power BI theme

A report theme is one file that sets every colour and font in Power BI. How to take the palette from an image, check it, and write it into the theme JSON.

Short answer: pick five to eight colours from the picture (a brand photo, a poster, an illustration), check that they differ in lightness and that text on your background passes contrast, then put them in a theme JSON as dataColors, with your background, text and sentiment colours. Import it on the View ribbon, Themes, Browse for themes, and every visual in the report takes the style at once.

Generic Power BI reports come from the default theme. A theme is a style written once and applied to every visual, and a picture whose mood fits the report is a quick place to find one.

How do you get from a picture to a theme?

  1. 1
    Pick the pictureone image whose mood fits the report
  2. 2
    Take the coloursfive to eight, with an eyedropper or a palette tool
  3. 3
    Check themlightness steps, contrast on the background, colour blind safety
  4. 4
    Write the JSONdataColors, background, foreground, good, neutral, bad
  5. 5
    ImportView, Themes, Browse for themes
From an image to a report theme

What does the theme file look like?

{
  "name": "Harbour at dusk",
  "dataColors": ["#2F5D8A", "#E39A6C", "#7FB7BE", "#D9C27A", "#8C6FA8", "#4E8C5B"],
  "background": "#FFFFFF",
  "foreground": "#1F2A44",
  "tableAccent": "#2F5D8A",
  "good": "#4E8C5B",
  "neutral": "#D9C27A",
  "bad": "#B5523B"
}

The first colour in dataColors goes to the first series in every chart, so put the colour you want to see most first.

How do you check the colours?

  • Lightness: turn the picture grey in your head; if two colours become the same grey, readers with colour blindness may not tell them apart.
  • Contrast: text and numbers need a contrast of at least 4.5 to 1 against the background.
  • Meaning: keep green for good and red for bad only if you also show the meaning another way, with a label or an icon.

Where can you check this?

Where do you start?

Every field in the file is explained in the report theme JSON. To build the theme with your palette, fonts and contrast checks in the browser, use Report Design Studio.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.