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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

JSON theme files not being imported

Hi, 

 

I am experiencing issues with the import of theme JSON files. The following is the sequence of events:

 

1. I click the "Save current theme" option in the original report that is configured with the theme that I want to use

2. I do not edit the theme JSON file at all, so it is exactly the same as the theme that is configured and working on the original report

3. I open a new report, click the "Browse for themes" option and select the theme JSON file from the original report

4. The theme import fails and it gives me this error message:

 

#/visualStyles/barChart/*/categoryAxis/0/position must be equal to one of the allowed values (enum: 'Left' ,'Right'; matching schema #/properties/visualStyles/properties/barChart/properties/*/allOf/1/properties/categoryAxis/items/properties/position/enum)
#/visualStyles/pieChart/*/labels/0/labelDisplayUnits must be integer (type; matching schema #/definitions/labelDisplayUnits/type)
#/visualStyles/pieChart/*/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/donutChart/*/labels/0/labelDisplayUnits must be integer (type; matching schema #/definitions/labelDisplayUnits/type)
#/visualStyles/donutChart/*/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/gauge/*/calloutValue/0/labelDisplayUnits must be integer (type; matching schema #/definitions/labelDisplayUnits/type)
#/visualStyles/gauge/*/calloutValue/0/labelDisplayUnits must be equal to one of the allowed values (enum: '0' ,'1' ,'1000' ,'1000000' ,'1000000000' ,'1000000000000'; matching schema #/definitions/labelDisplayUnits/enum)
#/visualStyles/kpi/*/indicator/0/indicatorDisplayUnits must be integer (type; matching schema #/definitions/labelDisplayUnits/type)
#/visualStyles/kpi/*/indicator/0/indicatorDisplayUnits must be equal to one of the allowed values (enum: '0' ,'1' ,'1000' ,'1000000' ,'1000000000' ,'1000000000000'; matching schema #/definitions/labelDisplayUnits/enum)

 

 

How can it fail and have errors in the JSON when the theme JSON files comes from the original report where it works? 

 

Thanks in advance! 

Status: Investigating
Comments
zapppsr
Kudo Collector

Hello fellow Power BI users,

 

I have a starter Power BI template file that includes a custom JSON theme that I crafted with attention to detail. I always use this file to begin a new dashboard.

 

Recently, I encountered issues with the new In-Object Editing feature and decided to create a clean file to test the problem. When I tried to import my JSON theme, I received an error message stating that it was incompatible and listed numerous errors that needed to be corrected.

 

The main issue is that when I attempt to customize the current theme, I receive an alert that I need to update the theme. I updated the theme hoping it would be error-free, but when I exported the JSON and tried to use it in another dashboard, I was surprised to find that it still had errors.

 

This means that the updated version inherited the previous errors. As noted in a previous post, changes in syntax and properties may occur over time, causing the JSON structure to change.

Therefore, it is necessary to find a better way to keep up with these changes; otherwise, our JSON themes may become obsolete and cause formatting issues.

 

I attempted to use the error log to fix the issues one by one, but I was unsuccessful.

 

As a result, I am currently unable to apply my JSON to other dashboards, and I am considering using websites that generate JSON themes for Power BI. If these websites are updated, I will visit them to see the new syntax for each visual and attempt to adjust them in my beloved theme.


Good luck to all of you.

 
 

 

zapppsr
Kudo Collector

 

I found this website that is aware of the structural changes in the JSON file and could help to rebuild your theme. You can upoload your theme and change it there in a visual way then export it again.

 

theme.png

MyriamW
Frequent Visitor

@zapppsr thank you for sharing this website, it may be very helpful in the future!

 

I now managed to repair my theme by checking all error messages and adjusting the code.

zapppsr
Kudo Collector

Hello @MyriamW , glad it helped.

I also found another site and it helped me generating bits and pieces to rebuild my theme.
I also managed to repair my theme.json. I hope they don't change the structure and syntax again very soon.

Screenshot 2023-04-18 074310.png

SteveFringe
Regular Visitor

hey, i've tried to fix it with the german website, but it messed up my theme. so instead, i've compared the "repaired" version with the initial.

the differences are:

"Center" vs "center" -> removed capitalization 

"15" vs 15 - in fontsize. removed the quotes. 

it worked right away. 

maybe can be helpful for some folks with small theme files