March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
Solved! Go to Solution.
Hi @fred65 - 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.
Use report themes in Power BI Desktop - Power BI | Microsoft Learn
Hope this helps you to fix the custom theme issue.
Proud to be a Super User! | |
Hi rajendraongole1 ,thanks for the quick reply, I'll add more.
Hi @fred65 ,
Regarding your question, first you need to download the software, using Notepad to encode is a disaster.
Download the latest file and save it in the same folder as your JSON file.
Add this line of code in your Json file, then save and restart 'vs code'
"$schema": "reportThemeSchema-2.132.json",
Then write the code and there will be a prompt.
{
"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"
}]
}
}
}
}
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
Hi rajendraongole1 ,thanks for the quick reply, I'll add more.
Hi @fred65 ,
Regarding your question, first you need to download the software, using Notepad to encode is a disaster.
Download the latest file and save it in the same folder as your JSON file.
Add this line of code in your Json file, then save and restart 'vs code'
"$schema": "reportThemeSchema-2.132.json",
Then write the code and there will be a prompt.
{
"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"
}]
}
}
}
}
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
Hi @fred65 - 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.
Use report themes in Power BI Desktop - Power BI | Microsoft Learn
Hope this helps you to fix the custom theme issue.
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |