Power bi themes

From julianobarbosa/claude-code-skills · View interactive version

Power bi themes is an AI agent skill from the GitHub repository julianobarbosa/claude-code-skills. Apply, inspect, and compare Power BI report themes and conditional formatting rules using pbi-cli. Invoke this skill whenever the user mentions "theme", "colours", "colors", "branding", "dark mode", "corporate theme", "styling", "conditional formatting", "colour scale", "gradient", "data bars", "bac

How to use this skill

Skill file

Power BI Themes Skill

Manage report-wide themes and per-visual conditional formatting. No Power BI

Desktop connection is needed.

Applying a Theme

Power BI themes are JSON files that define colours, fonts, and visual defaults

for the entire report. Apply one with:

pbi report set-theme --file corporate-theme.json

This copies the theme file into the report's StaticResources/RegisteredResources/

folder and updates report.json to reference it. The theme takes effect when

the report is opened in Power BI Desktop.

Inspecting the Current Theme

pbi report get-theme

Returns:

Comparing Themes

Before applying a new theme, preview what would change:

pbi report diff-theme --file proposed-theme.json

Returns:

This helps catch unintended colour changes before committing.

Theme JSON Structure

A Power BI theme JSON file typically contains:

{
  "name": "Corporate Brand",
  "dataColors": ["#0078D4", "#00BCF2", "#FFB900", "#D83B01", "#8661C5", "#00B294"],
  "background": "#FFFFFF",
  "foreground": "#252423",
  "tableAccent": "#0078D4",
  "visualStyles": { ... }
}

Key sections:

See Microsoft theme documentation for the full schema.

Conditional Formatting

Apply data-driven formatting to individual visuals:

# Gradient background (colour scale from min to max)
pbi format background-gradient visual_abc --page page1 \
    --table Sales --column Revenue \
    --min-color "#FFFFFF" --max-color "#0078D4"

# Rules-based background (specific value triggers a colour)
pbi format background-conditional visual_abc --page page1 \
    --table Sales --column Status --value "Critical" --color "#FF0000"

# Measure-driven background (a DAX measure returns the colour)
pbi format background-measure visual_abc --page page1 \
    --table Sales --measure "Status Color"

# Inspect current formatting rules
pbi format get visual_abc --page page1

# Clear all formatting rules on a visual
pbi format clear visual_abc --page page1

Workflow: Brand a Report

# 1. Create the theme file
cat > brand-theme.json << 'EOF'
{
  "name": "Acme Corp",
  "dataColors": ["#1B365D", "#5B8DB8", "#E87722", "#00A3E0", "#6D2077", "#43B02A"],
  "background": "#F8F8F8",
  "foreground": "#1B365D",
  "tableAccent": "#1B365D"
}
EOF

# 2. Preview the diff against the current theme
pbi report diff-theme --file brand-theme.json

# 3. Apply it
pbi report set-theme --file brand-theme.json

# 4. Verify
pbi report get-theme

JSON Output

pbi --json report get-theme
pbi --json report diff-theme --file proposed.json
pbi --json format get vis1 --page p1

Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.