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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Old Custom Theme JSON File Errors

Hi All,

 

I am getting errors (over 140) loading a custom theme file. My Current version of PBI Desktop is Dec 2023.

It seems that much has changed over the years and all errors are related to visuals. I have managed to fix a bunch but not sure what to do with others.

 

Is there a reference page that gives me details of the changes? I am unable to find anything on the internet.
One example is with PieChart:

#/visualStyles/pieChart/*/labels/0/background must be string (type; matching schema #/properties/visualStyles/properties/pieChart/properties/*/allOf/1/properties/labels/items/properties/background/type)
#/visualStyles/pieChart/*/labels/0/background must be equal to constant (const; matching schema #/properties/visualStyles/properties/pieChart/properties/*/allOf/1/properties/labels/items/properties/background/oneOf/0/const)
#/visualStyles/pieChart/*/labels/0/background must be equal to constant (const; matching schema #/properties/visualStyles/properties/pieChart/properties/*/allOf/1/properties/labels/items/properties/background/oneOf/1/const)
#/visualStyles/pieChart/*/labels/0/background must be equal to constant (const; matching schema #/properties/visualStyles/properties/pieChart/properties/*/allOf/1/properties/labels/items/properties/background/oneOf/2/const)
#/visualStyles/pieChart/*/labels/0/background must match exactly one schema in oneOf (oneOf; matching schema #/properties/visualStyles/properties/pieChart/properties/*/allOf/1/properties/labels/items/properties/background/oneOf)

Here is the code that used to work:

 "pieChart": {
            "*": {
                "labels": [
                    {
                        "show": true,
                        "labelStyle": "Category",
                        "fontSize": 11,
                        "fontFamily": "Segoe UI Bold, wf_segoe-ui_bold, helvetica, arial, sans-serif",
                        "position": "preferOutside",
                        "overflow": false,
                        "background": {
                            "show": false
                        }
                    }
                ]
            }
        }

 

Any assistance appreciated!

Cheers

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @Anonymous - Use a JSON schema validator with the official Power BI theme schema link shared below.as per my observation your current error that the background property under labels for pieChart is no longer just a boolean or a simple string value but may require a specific type or constant value.Try adjusting properties like background, position, etc., to see what combination works. If a property is causing issues, sometimes it's best to remove it and test the theme without it.

theme (jsonformatter.org)

 

rajendraongole1_0-1725254668717.png

 

Use report themes in Power BI Desktop - Power BI | Microsoft Learn

 

Hope this helps you to fix the custom theme issue. 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi rajendraongole1 ,thanks for the quick reply, I'll add more.

Hi @Anonymous ,

Regarding your question, first you need to download the software, using Notepad to encode is a disaster.

vzhouwenmsft_0-1725345927043.png

Download the latest file and save it in the same folder as your JSON file.

powerbi-desktop-samples/Report Theme JSON Schema at main · microsoft/powerbi-desktop-samples · GitHu...

vzhouwenmsft_1-1725346068264.png

vzhouwenmsft_2-1725346157253.png

vzhouwenmsft_3-1725346186441.png

Add this line of code in your Json file, then save and restart 'vs code'

"$schema": "reportThemeSchema-2.132.json",

vzhouwenmsft_4-1725346407723.png

Then write the code and there will be a prompt.

vzhouwenmsft_5-1725346482290.png

vzhouwenmsft_6-1725346574467.png

{
	"name": "PieChartTemplate",
	"$schema": "reportThemeSchema-2.132.json",
	"visualStyles": {
		"pieChart": {
			"*": {
				"labels": [{
					"show": true,
					"labelStyle": "Category",
					"fontSize": 20,
					"fontFamily": "Segoe UI Bold, wf_segoe-ui_bold, helvetica, arial, sans-serif",
					"position": "preferOutside",
					"overflow": false,
					"background": "off"
				}]
			}
		}
	}
}

vzhouwenmsft_7-1725346640316.png

GitHub - MattRudy/PowerBI-ThemeTemplates: JSON Templates for assembling Power BI Themes

The template here is a little newer, but it seems to have some problems and needs to be modified according to the error message in Power BI.

 

Best Regards,
Wenbin Zhou

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi rajendraongole1 ,thanks for the quick reply, I'll add more.

Hi @Anonymous ,

Regarding your question, first you need to download the software, using Notepad to encode is a disaster.

vzhouwenmsft_0-1725345927043.png

Download the latest file and save it in the same folder as your JSON file.

powerbi-desktop-samples/Report Theme JSON Schema at main · microsoft/powerbi-desktop-samples · GitHu...

vzhouwenmsft_1-1725346068264.png

vzhouwenmsft_2-1725346157253.png

vzhouwenmsft_3-1725346186441.png

Add this line of code in your Json file, then save and restart 'vs code'

"$schema": "reportThemeSchema-2.132.json",

vzhouwenmsft_4-1725346407723.png

Then write the code and there will be a prompt.

vzhouwenmsft_5-1725346482290.png

vzhouwenmsft_6-1725346574467.png

{
	"name": "PieChartTemplate",
	"$schema": "reportThemeSchema-2.132.json",
	"visualStyles": {
		"pieChart": {
			"*": {
				"labels": [{
					"show": true,
					"labelStyle": "Category",
					"fontSize": 20,
					"fontFamily": "Segoe UI Bold, wf_segoe-ui_bold, helvetica, arial, sans-serif",
					"position": "preferOutside",
					"overflow": false,
					"background": "off"
				}]
			}
		}
	}
}

vzhouwenmsft_7-1725346640316.png

GitHub - MattRudy/PowerBI-ThemeTemplates: JSON Templates for assembling Power BI Themes

The template here is a little newer, but it seems to have some problems and needs to be modified according to the error message in Power BI.

 

Best Regards,
Wenbin Zhou

 

rajendraongole1
Super User
Super User

Hi @Anonymous - Use a JSON schema validator with the official Power BI theme schema link shared below.as per my observation your current error that the background property under labels for pieChart is no longer just a boolean or a simple string value but may require a specific type or constant value.Try adjusting properties like background, position, etc., to see what combination works. If a property is causing issues, sometimes it's best to remove it and test the theme without it.

theme (jsonformatter.org)

 

rajendraongole1_0-1725254668717.png

 

Use report themes in Power BI Desktop - Power BI | Microsoft Learn

 

Hope this helps you to fix the custom theme issue. 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.