Theming with Microsoft Power BI

21.08.2018 / #Power BI


The last Power BI update has already made the theming compatibilities general available. I was very happy to get also this feature at the Power BI Reporting Services with the August 2018 update. So it gives me the possibilities, to make a default branding of my reports where I not have customize the colors, titles, legends and so on…

This article will make a short introduction how to use this feature:

{
    "name": "my Test Theme",
    "dataColors": ["#68724F","#AA4225","#8C1E2B","#346778","#856980"],
    "background": "#EEEEEE",
    "foreground": "#000000",
    "tableAccent":"#568410",
   }

These are the basic options. There you can set a name, default colors for the visuals, a report back-/foreground color and the accent color for tables (header and bottom lines)

Mostly you spent much time when you set the colors. But you will also spend much time to set the font colors, font size at the visuals. Also, there will be at the most visuals a title, mostly I want to hide this, until the report author enters a title:

In the most cases I don’t want to format every visual, I have there some standards. So you use the Asterix and set these standards to all the visuals:

"visualStyles":
    {
        "*":
            {
                "*":
                {
                    "general": [{
                                "responsive": true
                        }],
                    "title": [
                            {
                                "show": false,
                                "fontColor": { "solid": { "color": "#000000"}},
                                "fontFamily": "Verdana",
                                "fontSize": 12 
                            }],
                    "categoryLabels": [
                            {
                                "show": true,
                                "fontFamily": "Verdana",
                                "fontColor": { "solid": { "color": "#000000"}},
                                "fontSize": 10
                            }],
                    "legend": [
                            { 
                                "fontFamily": "Verdana", 
                                "fontSize": 10,
                                "fontColor": { "solid": { "color": "#000000"}}
                            }],
                    "labels": [
                            { 
                                "fontFamily": "Verdana",
                                "fontSize": 10,
                                "fontColor": { "solid": { "color": "#000000"}},
                                "position": "inside",
                                "show": true,
                                "labelStyle": "Data"
                            }]
                }
            },

With this code there a standard setting to the title, Category Labels, Legends and Labels. So, every visuals will get the font family, size and color. The Labels are set to inside and we will get a label style.

If you need special setting to a visual, you can set it also in the JSON file:

"pieChart": 
            {
                "*": 
                {
                    "legend": 
                        [{
                        "show": true,
                        "position": "Bottom",
                        "showTitle": false,
                        "titleText": "...."
                        }]
                }
            }

If you want to test it, download the file here and import it to the Power BI report. Please rename it to “My First Theme.json”.

Further information:
https://github.com/deldersveld/PowerBI-ThemeTemplates
https://docs.microsoft.com/en-us/power-bi/desktop-report-themes

Okay, that’s it! Thanks for reading and have lot of fun with the theming!

If we can help you or you know how to use our competencies - let us meet for a coffee. You can also call us, send an email, traditional letter or a pigeon.


Related posts


Join the discussion