Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MagicMads
Helper I
Helper I

Custom Themes

How do you set the background color for all visuals?

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

@MagicMads,

 

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

View solution in original post

3 REPLIES 3
jsh121988
Employee
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.

v-caliao-msft
Employee
Employee

@MagicMads,

 

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

Anonymous
Not 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!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors