Forum Discussion
Custom Themes
How do you set the background color for all visuals?
To apply a Report Theme to a Power BI Desktop report, select Switch Theme button from the Home ribbon, then select Import Theme from the drop-down. A window appears that lets you navigate to the location of the JSON theme file. The basic JSON file selected in the previous section (the St Patricks Day.json file), when opened in an editor, looks like the following.You can change the color in that JSON file.
Reference
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-report-themes/Regards,
Charlie Liao
3 Replies
- v-caliao-msftMicrosoft Employee
To apply a Report Theme to a Power BI Desktop report, select Switch Theme button from the Home ribbon, then select Import Theme from the drop-down. A window appears that lets you navigate to the location of the JSON theme file. The basic JSON file selected in the previous section (the St Patricks Day.json file), when opened in an editor, looks like the following.You can change the color in that JSON file.
Reference
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-report-themes/Regards,
Charlie Liao
- AnonymousNot applicable
This does not change the background color of teh visuals. Has anyone been able to do this. If so pls share the JSON code.
Thanks!
- jsh121988Microsoft Employee
"visualStyles": { "*": { "*": { "background": [{ "show": { "expr": { "Literal": { "Value": "true" } } }, "color": { "solid": { "color": { "expr": { "ThemeDataColor": { "ColorId": 4, "Percent": 0 } } } } }, "transparency": { "expr": { "Literal": { "Value": "11D" } } } }]
} } }It'll change everything, but this will get you started. I "reversed engineered" a pbit file. The report/layout file is just json, and you can look to the config sections for the theme code. To open pbit contents, rename the extension to .zip and extract. To make it easier to read json, open the file in VSCode, and beautify using JS/JSON. For config sections, you'll need to replace '\"' with '"', and then beautify again.