Why your Power BI theme doesn't change SVG and custom visuals
You apply a new theme, the charts change color, but a donut, a KPI card or a progress bar keeps its old orange. Usually the theme is fine: that visual simply never reads it.
Which visuals ignore the theme
- SVG or HTML built in a DAX measure, shown in a table, card, Image visual or an HTML Content visual. The colors are written as text inside the measure, for example
"#D9822B", so Power BI has nothing to replace. - Deneb and other Vega or Vega-Lite visuals with colors typed into the specification.
- Custom visuals from AppSource that use their own color settings instead of the report palette. Each developer decides how much of the theme the visual uses.
- Images: a PNG or SVG file placed on the page always keeps the colors it was drawn with.
SVG and HTML measures: keep colors in one place
DAX cannot read the theme, so the next best thing is to stop scattering hex codes through your measures. Create a small set of color measures that match the theme palette and reference them everywhere:
Color Accent = "#1F3A68"
Color Positive = "#2E9E6A"
Color Track = "#E6E8EE"
Donut SVG =
VAR c = SUBSTITUTE([Color Accent], "#", "%23")
RETURN "data:image/svg+xml;utf8,<svg ...><circle stroke='" & c & "' ... /></svg>"
When the theme changes, you update those few measures and every SVG follows. Copy the hex values straight from the palette in Temat Studio. Inside a data URL the # sign has to be written as %23, which is why the measure uses SUBSTITUTE.
Deneb: use the theme colors directly
Deneb can read the report theme. Instead of a fixed color, use the pbiColor() expression, where 0 is the first data color of the theme:
"color": {"expr": "pbiColor(0)"}
For a whole series of colors, use the built-in theme schemes, for example "scale": {"scheme": "pbiColorNominal"}. Then the visual changes with every new theme.
Custom visuals from AppSource
- Check the visual's Format pane: many have a color option that defaults to the theme until you change it. Resetting it to default often brings the theme back.
- Some visuals can be styled from the theme file through
visualStylesunder the visual's own name, but only for the properties the developer exposed. - If the visual has neither, set its colors by hand once, using the hex codes from your palette.
Quick check
If a visual stays the same after a new theme, select it and open the Format pane. If its colors are there and marked as changed, it is manual formatting, which you can remove in bulk. If they are not there at all, the colors live in a measure, a specification or the visual itself, as described above.
Try it in Temat Studio
Free, no account, runs in your browser.
All guides
- How to create a dark theme in Power BI
- Power BI theme JSON explained
- How to use your company colors in Power BI
- Why your Power BI theme doesn't change every visual
- How to add icons to a Power BI report
- Custom icons in Power BI tables: conditional formatting with your own icons
- How to share a Power BI theme with your team