Power BI Theme JSON Structure
Understanding the JSON structure that powers every Power BI theme.
Overview
A Power BI theme is a JSON file that controls the visual appearance of your reports. It defines everything from color palettes and typography to borders, shadows, and individual visual customizations. Understanding this structure allows you to create consistent, professional designs that align with your brand standards.
The theme JSON consists of several main sections: global settings that apply to all visuals, structural colors for UI elements, text classes for typography, and visual styles for specific chart types. Each section works together to create a cohesive visual experience across your entire report.
Global Settings
Global settings in the visualStyles["*"] object apply universally to all visuals in your report. These include borders, backgrounds, shadows, and general styling that creates consistency. You define these once and they automatically apply everywhere, though you can override them for specific visual types when needed.
Common global properties include border configuration (color, width, radius), background settings (color, transparency), drop shadows (position, blur, distance), and padding. These foundational elements ensure every visual in your report shares the same professional appearance without requiring individual configuration.
"visualStyles": {
"*": {
"*": {
"border": [{ "show": true, "color": { "solid": { "color": "#E0E0E0" }}, "radius": 4 }],
"background": [{ "color": { "solid": { "color": "#FFFFFF" }}, "transparency": 0 }]
}
}
}
Structural Colors
Power BI calls these "structural colors" - they define the foundational color elements across your report interface rather than data visualizations. Microsoft divides these into six color classes: firstLevelElements (primary foreground), secondLevelElements (secondary text), thirdLevelElements (gridlines and accents), fourthLevelElements (dimmed colors), background, and secondaryBackground. These colors create the consistent visual foundation that your data visualizations sit within.
In Power UI's Theme Studio, we simplify this as "Colors" for easier understanding. These structural colors affect multiple visual elements including label colors, axis and gridline styles, legend formatting, table grids, and slicer appearances. Power UI automatically manages the relationships between these colors to ensure proper contrast and visual hierarchy throughout your reports, while still giving you granular control when needed.
{
"background": "#FFFFFF",
"foreground": "#000000",
"tableAccent": "#118DFF",
"backgroundLight": "#F5F5F5",
"backgroundNeutral": "#E0E0E0"
}
Text Classes (Formatted Text Defaults)
Power BI officially calls these "formatted text defaults" - reusable typography styles that maintain consistency across all text elements in your report. Microsoft divides these into four primary text classes: "label" (for table/matrix values), "title" (for axis and chart titles), "callout" (for card data labels and KPI indicators), and "header" (for key influencer headers). Each class specifies font family, size, weight, and color.
Power UI presents these as "Text Classes" in the Theme Studio for clarity. The system uses inheritance where secondary classes like "boldLabel" or "smallLabel" automatically derive from primary classes, often with lighter colors or adjusted sizes. These classes are referenced throughout visual styles using the $textClasses notation, ensuring that changing a text class definition automatically updates every instance across your theme. This hierarchical approach makes it easy to maintain typography consistency while allowing detailed customization where needed.
"textClasses": {
"title": {
"fontSize": 14,
"fontFamily": "Segoe UI Semibold",
"color": "#000000"
},
"label": {
"fontSize": 10,
"fontFamily": "Segoe UI",
"color": "#666666"
}
}
Visual Styles
The visualStyles object contains customizations for specific visual types like barChart, card, table, and others. Each visual can have multiple property groups controlling different aspects: dataPoint for colors, labels for text, title for headers, and many more depending on the visual type.
Power UI's style presets feature extends this concept by allowing multiple named variations per visual type. This means you can create different styles for the same chart type and apply them contextually - for example, a bold style for executive dashboards and a subtle style for detailed reports.
Data Colors
Data colors define the palette used for chart series, categories, and data points. Power BI cycles through these colors automatically when displaying multiple data series. A well-designed palette ensures clear differentiation between data points while maintaining visual harmony.
Power UI provides intelligent palette generation based on your brand colors, ensuring sufficient contrast between adjacent colors and appropriate color relationships for different chart types. You can also import existing palettes or create custom combinations that align with your organization's data visualization standards.
Complete Example
Here's a minimal but complete theme JSON that demonstrates the key sections working together:
{
"name": "Corporate Theme",
"dataColors": ["#0078D4", "#40E0D0", "#FFA500", "#DC143C"],
"background": "#FFFFFF",
"foreground": "#323130",
"tableAccent": "#0078D4",
"textClasses": {
"title": {
"fontSize": 14,
"fontFamily": "Segoe UI Semibold"
}
},
"visualStyles": {
"*": {
"*": {
"border": [{ "show": true, "radius": 4 }]
}
}
}
}
Learn More
For detailed property references and advanced customization options, refer to the official Power BI documentation or explore themes visually in the Theme Studio.