Forum Discussion
Custom themes are broken
Hello,
February 2023 update broke the json custom themes. Everytime I try to apply my json theme that worked before, I get the following error message:
#/visualStyles/card/*/labels/0/labelDisplayUnits must be integer (type; matching schema #/definitions/labelDisplayUnits/type)
#/visualStyles/card/*/labels/0/labelDisplayUnits must be equal to one of the allowed values (enum: '0' ,'1' ,'1000' ,'1000000' ,'1000000000' ,'1000000000000'; matching schema #/definitions/labelDisplayUnits/enum)
#/visualStyles/slicer/*/general/0/orientation must be integer (type; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/general/items/properties/orientation/type)
#/visualStyles/slicer/*/general/0/orientation must be equal to one of the allowed values (enum: '0' ,'1'; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/general/items/properties/orientation/enum)
#/visualStyles/slicer/*/data/0/relativeRange must be equal to one of the allowed values (enum: 'Last' ,'Next' ,'This'; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/data/items/properties/relativeRange/enum)
#/visualStyles/slicer/*/data/0/relativePeriod must be equal to one of the allowed values (enum: 'None' ,'Days' ,'Weeks' ,'Calendar Weeks' ,'Months' ,'Calendar Months' ,'Years' ,'Calendar Years'; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/data/items/properties/relativePeriod/enum)
#/visualStyles/slicer/*/header/0/background/solid/color must match pattern "^#([a-fA-F0-9]{3}){1,2}$" (pattern; matching schema #/definitions/color/pattern)
#/visualStyles/slicer/*/header/0/background/solid/color must be object (type; matching schema #/definitions/themeDataColor/type)
#/visualStyles/slicer/*/header/0/background/solid/color must match exactly one schema in oneOf (oneOf; matching schema #/oneOf/0/properties/solid/properties/color/oneOf)
#/visualStyles/slicer/*/header/0/background must have required property 'gradient' (required; matching schema #/oneOf/1/required)
#/visualStyles/slicer/*/header/0/background must NOT have additional properties (additionalProperties; matching schema #/oneOf/1/additionalProperties)
#/visualStyles/slicer/*/header/0/background must have required property 'pattern' (required; matching schema #/oneOf/2/required)
#/visualStyles/slicer/*/header/0/background must NOT have additional properties (additionalProperties; matching schema #/oneOf/2/additionalProperties)
#/visualStyles/slicer/*/header/0/background must match exactly one schema in oneOf (oneOf; matching schema #/oneOf)
It looks like the criteria has been changed with February 2023 and if you follow all the error messages, it will then work.
13 Replies
- MarcoDekkerHelper I
so, this is caused by a februar 2023 update. I feel rather sad, Microsoft does not provide a tool to convert. As PBI changes over time, this is likely going to happen many more times.😕
Or i am wrong?
- peteratdcbelFrequent Visitor
It looks like the criteria has been changed with February 2023 and if you follow all the error messages, it will then work.
- siddhartha0208Helper I
I don't even have an error message!! What do I do now? Anyone in PowerBI listening and willing to give me a fix please?
- RudzKudo Collector
Here's a method to figure out errors.
- Install a code editor like VS Code. Yeah, this is a pain if you don't have it yet, but this is what Microsoft is giving us to work with! VS Code is free and useful though.
- Go to the GitHub site where Microsoft is posting the schema file:
Report Theme JSON Schema at powerbi-desktop-samples (github.com) - Find the most current reportThemeSchema file and click the link to open it in the viewer page.
- Then click the Raw button to open the file itself.
- Right click the file and choose Save as to download this file. Store it in the same folder as your theme.
- Open your theme in VS Code
- Add this line to the top of your theme after the "name" line, with the version matching the downloaded file:
"$schema": "reportThemeSchema-2.114.json", - The PROBLEMS pane will show the theme errors:
Don't be overwhelmed if your theme has lots of problems. In one of our most complete themes, we had over 100 errors. Until now, there was no easy way to validate a theme, and often the same set of code is copied over and over again. Our 100 errors were probably the same 4 mistakes repeated throughout the theme. - Click on an error and it will take you to the line in the theme that needs to be fixed. Some errors are relativelty easy to figure out. Here, the 0 should not be in quotes:
Some are a littler harder to correct. In this case, the code has all kinds of properties that aren't valid:You can open the schema file and trace through the properties to figure out what is valid code, in this case: "background": { "solid": { "color": "#DDDDDD" } },
This isn't always easy to figure out. If you are struggling with this part, copy out the lines of code in yellow and open a new issue here and someone can help fix that code. Or better yet, paste in the whole theme. Always open a new question unless you are asking for clarification on the exact same issue as another problem. When you ask questions on a problem that is already marked resolved like this one, often no one looks at them and you are less likely to get a reply.
- MagnoliaFrequent Visitor
what does it mean "follow all the error messages" ?
- peteratdcbelFrequent Visitor
Can you send a screen shot of your error messages?
- DavidS524Helper I
Hi everyone,
My custom theme has broken as well. After already fixing the initial error which was caused by some values that were in quotes and should now be integers, I still get this error when trying to import:
#/visualStyles/slicer must NOT have additional properties (additionalProperties; matching schema #/properties/visualStyles/properties/slicer/additionalProperties)
In addition I followed the steps that Rudz posted (thank you!) and the following errors are flagged in VS Code:
Property multiRowCard is not allowed.
Property tableEx is not allowed.
Property pivotTable is not allowed.
I initially thought that these may have been renamed but the strange thing is that when browsing through the schema JSON, all of those are still included. If I delete all four, slicer, MultiRowCard, TableEx, and PivotTable, the theme will load. Ideally though I would like to keep them in with whatever changes are now required. Does anyone have any ideas on how to fix these?
- RudzKudo Collector
I'm not an expert here, but in the schema these vlisuals (slicer, multiRowCard, etc.) have a setting of
"additionalProperties": falseThis means no additional properties will be allowed.1 Any property you use has to be in the schema.
I'm guessing that one of the properties you have under each of these visuals was either removed or you have a typo. If you can't find it, paste in your slicer code here (or your whole theme if you want).
- HaiVNHelper III
Can Anyone help me!
My problem is at the backgrouns of title in the slicer. The earlier verstion of json file I used (. But it is not accepted now and we have to choose a color but How can I predifine the bacground at the title to be transperancy ( 100%)?
Thank you!