Theming Power BI Organizational Custom Visuals

I’ve recently created a Power BI Custom Visual for our BOQ report headers, as we have a specific header visual style that we want all reports to have:

Normally when theming a custom visual that you import as a file, you just need to use the guid property of the custom visual (in pbiviz.json) as the key in the theme JSON file. For example, we use BOQGroupHeader in both pbiviz.json and theme.json:

pbiviz.json

{
    "visual": {
        "name": "BOQGroupHeader",
        "displayName": "BOQ Group Header",
        "guid": "BOQGroupHeader",
    }
}

theme.json

{
    "visualStyles": {
        "BOQGroupHeader": {
          "*": {
            "background": [
              {
                "show": false
              }
            ],
            "title": [
              {
                "show": false
              }
            ]
          }
        }
    }
}

However, when users download the custom visual from Power BI Service as a Organisational Visual, the theme file does not work. This is because Microsoft must change the guid property of the visual to ensure it doesn’t collide with file imported visuals vs Organisational Visuals.

If you open up the pbix file, you can find that Microsoft add a suffix of _OrgStore to the Organisational Visual, and this needs to be added to the theme file for the custom visual then to use that theme.

So our new theme.json looks like:

{
    "visualStyles": {
        "BOQGroupHeader_OrgStore": {
          "*": {
            "background": [
              {
                "show": false
              }
            ],
            "title": [
              {
                "show": false
              }
            ]
          }
        }
    }
}

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *