Report themes in Power BI: the JSON file explained

How Power BI report themes work, built-in and organizational themes, customizing the current theme, the theme JSON file with dataColors, good, neutral, bad, text classes and visual styles, series colour order, the base theme, and theme colours in DAX.

Short answer: a report theme sets the colours, fonts and default formatting of every visual in a report at once. Pick a built-in theme on the View (Desktop) ribbon, an organizational theme your admin published, or import a JSON theme file. The JSON holds the series colours (dataColors), the sentiment colours (good, neutral, bad), the gradient colours (minimum, center, maximum), the text classes (title, label, callout) and visualStyles with default settings per visual type. Export the current theme, edit it, and import it into every report.

Formatting twelve visuals by hand gives twelve slightly different greys and three font sizes. A theme sets it once, and a change of brand colour becomes one file instead of a week.

The video below shows a whole report look designed on a live preview, checked for contrast, and exported as a theme JSON, in about a minute.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

What does a theme file look like?

{
  "name": "Northwind",
  "dataColors": ["#2F7CF6", "#FFC72C", "#20C997", "#E39A6C", "#A577FF", "#F2696B"],
  "background": "#FFFFFF",
  "foreground": "#1B1F2A",
  "tableAccent": "#2F7CF6",
  "good": "#1A9E75",
  "neutral": "#E0A400",
  "bad": "#D64550",
  "maximum": "#2F7CF6",
  "center": "#E8EEF9",
  "minimum": "#FFFFFF",
  "textClasses": {
    "title": { "fontFace": "Segoe UI Semibold", "fontSize": 14, "color": "#1B1F2A" },
    "label": { "fontFace": "Segoe UI", "fontSize": 10, "color": "#5F6370" },
    "callout": { "fontFace": "Segoe UI Semibold", "fontSize": 28, "color": "#1B1F2A" }
  },
  "visualStyles": {
    "*": { "*": { "border": [{ "show": false }], "dropShadow": [{ "show": false }] } },
    "columnChart": { "*": { "dataLabels": [{ "show": true }] } }
  }
}
KeySets
dataColorsthe colours of series, in order: the first series gets the first colour
background, foreground, tableAccentpage and text colours, the accent of tables and matrices
good, neutral, badsentiment colours, used by KPIs, waterfalls and theme names in DAX
maximum, center, minimumdefault gradient colours for conditional formatting
textClassesfonts for titles, labels, callouts and other text roles
visualStylesdefault format settings per visual type ("*" for all)
What the main keys set

How do you apply and edit a theme?

  1. View, Themes gallery: a built-in theme, or one of your organization's themes if an admin added them.
  2. Customize current theme: change colours, text, visuals, page and filter pane in a dialog; it saves as a custom theme in the report.
  3. Save current theme: exports the theme as JSON. Edit it in VS Code, then Browse for themes to import it into this and other reports.
  4. Organizational themes: an admin publishes a theme for the whole tenant, so every report author can apply the company look from the gallery.

Applying a theme replaces the previous custom theme. Visuals using theme colours update; colours picked from More colors stay fixed. Reset to default in a visual's format pane returns it to the theme.

How are series colours assigned?

When a visual has a series (a legend, or more than one measure), Power BI assigns dataColors in order. Microsoft notes that the assignment differs between static series (several measures) and dynamic series (a legend field), which can make the same category get different colours in different visuals. Fix important colours per category in the visual, or keep the category order the same everywhere.

Can DAX use theme colours?

Yes. In Field value conditional formatting, a measure can return a theme colour name instead of a hex code:

Margin Status =
SWITCH ( TRUE (), [Margin %] >= 0.3, "good", [Margin %] >= 0.2, "neutral", "bad" )

The visual then uses the current theme's good, neutral or bad colour. Change the theme, and every status colour follows.

What is the base theme?

Under any custom theme sits the base theme: Power BI's default styling. Power BI may update it in new releases, but existing reports keep their original base theme until you update it (see visual defaults). A new base theme can change spacing and defaults in reports that do not set them.

What goes wrong?

  • Hard-coded colours. Visuals formatted with "More colors" ignore the theme; reset them to default.
  • Too few dataColors. With 8 colours and 12 series, colours repeat; group categories or add colours.
  • Fonts readers do not have. Use fonts available in browsers and the Power BI service (Segoe UI and the fonts in the font list).
  • Inconsistent category colours. Static and dynamic series pick colours differently; fix colours for important categories.
  • One theme per report by hand. Publish an organizational theme, or keep one JSON file in source control.

Where can you check this?

Where do you start?

Export your current theme, set dataColors and good, neutral, bad to your brand, add two visualStyles defaults you always change by hand, and import it into every report. Conditional formatting uses the sentiment colours.

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.