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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
peteratdcbel
Frequent Visitor

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:

 

peteratdcbel_0-1676563672131.png

 

 

peteratdcbel_1-1676563692798.png

 

#/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)

 

 

1 ACCEPTED SOLUTION
peteratdcbel
Frequent Visitor

It looks like the criteria has been changed with February 2023 and if you follow all the error messages, it will then work. 

View solution in original post

12 REPLIES 12
HaiVN
Helper I
Helper I

Can Anyone help me!

My problem is at the backgrouns of title in the slicer. The earlier verstion of json file  I used (

HaiVN_1-1714111352321.png

 

 

. 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!

MarcoDekker
Helper I
Helper 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?

DavidS524
Helper I
Helper 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?

I'm not an expert here, but in the schema these vlisuals (slicer, multiRowCard, etc.) have a setting of 

"additionalProperties": false

This 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).

peteratdcbel
Frequent Visitor

It looks like the criteria has been changed with February 2023 and if you follow all the error messages, it will then work. 

siddhartha0208_0-1677820789624.png

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?

Here's a method to figure out errors.

  1. 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.
  2. Go to the GitHub site where Microsoft is posting the schema file:
    Report Theme JSON Schema at powerbi-desktop-samples (github.com)
  3. Find the most current reportThemeSchema file and click the link to open it in the viewer page. 
    Rudz_0-1678290351914.png
  4. Then click the Raw button to open the file itself.
    Rudz_1-1678290381615.png
  5. Right click the file and choose Save as to download this file. Store it in the same folder as your theme.
    Rudz_7-1678291382545.png
  6. Open your theme in VS Code
  7. 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",
    Rudz_8-1678291529551.png
  8. The PROBLEMS pane will show the theme errors:
    Rudz_2-1678290563977.png
    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.
  9. 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:
    Rudz_4-1678290809117.png
    Some are a littler harder to correct. In this case, the code has all kinds of properties that aren't valid:
    Rudz_6-1678290942891.png

    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.

Thanks @Rudz for explaining the method to fix the error in a detailed manner. I learnt in the process of fixing the theme file a lot. It was kind of urgent as my large team was facing issues and our service delivery was somewhat impacted. We had started using old files - to get into the new projects with Organizational theme.
The problems are fixed now and a new theme file is in place to import - which works as expected.

Did you use a json file to create your custom theemes? If so, check your file and comment or remove properties or remoe the part that has "additionalProperties" and try again

what does it mean "follow all the error messages" ?

@MagnoliaSee my reply to siddhartha0208 for the steps to see your theme error messages.

Can you send a screen shot of your error messages? 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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