Template Theme Files for Power BI Visuals

Template Theme Files for Power BI Visuals
Reading Time: 2 minutes

A few months ago, Power BI expanded the capabilities of Themes to include more than colors. You can now change the Format and even configure Analytics such as forecasting. In a previous post, I looked at how you can use the wildcard character (*) to universally set formatting under visualStyles. Here, I want to share the fruit of some work to catalog low-level properties on a per-visual basis. The files can act as a code reference to see the structure of each visual’s format options. They should be not treated as final Theme files like those you find in the Themes Gallery. 

Before creating Themes in Power BI, it would be helpful to review the documentation on Report Themes. I had a lot of trouble and confusion with how the properties for all visuals are presented together in the documentation, so I split things out into separate visuals and also filled in some gaps. This made it easier for me to compare what I was seeing in a visual’s Format menu with what I was adding to a theme file.

–>> Get them from GitHub or view the list of individual links below: PowerBI-ThemeTemplates repository<<–

If you notice an issue, log it in the GitHub repository. Better yet, fork it, fix the problem, and submit a pull request.

ShapeTemplate

Glancing at any of the JSON files, you should notice that there are properties with names that do not align with what you see in Power BI’s Format menu. Properties used in Themes are based on the code used in the visual and not the display name that users see in Power BI. Sometimes these names match but usually they do not. For example, in the screenshot above for a Shape, “Rotation” in Power BI Desktop corresponds to “angle” in the JSON.

These template files function as a quick reference for anyone who does not simply want to rely on using wildcards (*) and who may not want to dig through the report theme documentation to figure it out on their own. Remember, these are not final theme files. They are more of a reference for the structure. Many of the values are not Power BI’s defaults but are set to easily verify a format change. In other words, these settings are often intentionally ugly so that I could easily check whether something changed.

Feel free to combine visuals, omit properties you don’t need, and change the sample values to what you want. Use these templates as guides to building your own themes.

Available Visuals:
Area Chart
Card
Clustered Bar Chart
Clustered Column Chart
Donut Chart
Filled Map
Funnel Chart
Gauge
Hundred Percent Stacked Bar Chart
Hundred Percent Stacked Column Chart
Image
KPI
Line Chart
Line and Clustered Column Chart
Line and Stacked Column Chart
Map
Matrix
Multi-row Card
Pie Chart
Ribbon Chart
Scatter Chart
Shape
Shape Map
Slicer
Stacked Area Chart
Stacked Bar Chart
Stacked Column Chart
Table
Treemap
Waterfall




10 Comments

  1. Thanks David,
    This is a great help for understanding the extended themes.
    But I cannot find an example of how to set some properties for every type of visual, by using wildcards “*”. Shouldn’t that also be possible?
    For example, how to set the font for everything to “Corbel”?
    Thanks!

  2. This is way better then the “help” that Microsoft put out. Very helpful… Thanks! One thing I still can’t figure out is how to apply the “DIN” font to a card visual.

  3. Hi David,

    Currently i am working on theme for Slicer visual. Please find JSON for slicer below.

    I want Default Slicer type as Dropdown instead of List. Please suggest me where should i do this change?

    {
    “name”: “N”,
    “visualStyles”: {
    “slicer”: {
    “*”: {
    “general”: [{
    “outlineColor”: { “solid”: { “color”: “#e5e5e5”}},
    “outlineWeight”: 1,
    “orientation”: “vertical”,
    “responsive”: true
    }],
    “data”: [{
    “mode”: “Basic”,
    “relativeRange”: “”,
    “relativePeriod”: “”
    }],
    “selection”: [{
    “selectAllCheckboxEnabled”: true,
    “singleSelect”: true
    }],
    “header”: [{
    “show”: true,
    “fontColor”: { “solid”: { “color”: “#ffffff”}},
    “background”: { “solid”: { “color”: “#008d5a”}},
    “outline”: “None”,
    “textSize”: 10,
    “fontFamily”: “Segoe UI”
    }],
    “items”: [{
    “fontColor”: { “solid”: { “color”: “#000000”}},
    “background”: { “solid”: { “color”: “”}},
    “outline”: “None”,
    “textSize”: 11,
    “fontFamily”: “Segoe UI”
    }]
    }
    }
    }
    }

    1. Unfortunately, since the List vs Dropdown setting is not in the standard Format area, I’m not sure how or if that can be themed.

  4. Hi David,

    Can I just thank you for this epic resource. The lengths you have gone to have saved me from many hours/days/weeks of frustration.

    If only Microsoft could supply the field property names for all the fields etc rather than a trial and error method i’m using.

    I’m aware of a resource by Curbal that provides a full guide and properties power BI but is expensive so if you find a dictionary of the properties that would be greatly appreciated.

    Kind regards
    Michael

Leave a Reply

%d bloggers like this: