Forum Discussion
Custom themes are broken
- 3 years ago
It looks like the criteria has been changed with February 2023 and if you follow all the error messages, it will then work.
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.
thx a lot for your answer, you helped us a lot!!
https://www.linkedin.com/posts/marjoleinopsteegh_powerbi-happyendusers-dashboarddesign-activity-7290400078211547138-EIA7?utm_source=share&utm_medium=member_desktop