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
Anonymous
Not applicable

Hi @Anonymous ,

 

Are you using the latest version of Power BI Desktop?
As a workaround,you may check if this problem still occur when you roll back to a previous version.

 

Best regards.
Community Support Team_ Caitlyn

MyriamW
Frequent Visitor

Hi, I am facing the exact same error.

I am using Version: 2.114.664.0 64-bit (Februar 2023).

I noticed it a few days ago.

 

Anonymous
Not applicable

Hi @Anonymous,

 

I am using Version: 2.114.664.0 64-bit (February 2023) and have been experiencing the issue since 20-02-2023. 

 

avanichheda
Microsoft Employee

Hi Team,

 

I am facing the issue since today 26-02-23 and was using the March 2023 version. Please let me know how to troubleshoot the same at the earliest.

 

Regards,

Avani

avanichheda
Microsoft Employee

Hello,

 

As a workaround I used a previous version of Dec 2022 Power BI and it seems to support the JSON theme files now. Hope that helps.

 

Regards,

Avani

MyriamW
Frequent Visitor

I just read the February 2023 Feature Summary and saw this article. It does not solve my problem because it says my json file is not valid but it was working before. But I think this may be the reason for the error message.

 

Report theme validation on custom theme import

Creating custom themes can be a daunting task, especially when there are so many visuals and formatting properties you can configure. Mistakes can occur when authoring the theme JSON, property names can change with time, or any number of other issues could render the custom theme file invalid when it’s imported into Power BI.

This month, we’re introducing a feature which will validate your theme file upon import to make sure we can successfully read its full contents. If Power BI finds fields it doesn’t understand, it will show you a message letting you know that the theme file is invalid, and invite you to re-import with a corrected theme file. We will also be publishing the schema Power BI uses to check your theme file in a public location, updating it automatically whenever we change it in Power BI, so that you can ensure your theme files are always current.

Anonymous
Not applicable

@MyriamW It makes sense that the additional validation would catch problems in the json file, but then it is the json export function in Power BI that might not deliver a json file that is up-to-date with this new validation method. 

@avanichheda I recognize rolling back to the Dec 2022 version is a workaround, but to me it seems like the Feb and Mar releases have issues with validating json theme files that come directly from the json theme export function in Power BI. What are the prospects for getting this fixed? 

avanichheda
Microsoft Employee

@MyriamW Thank you for sharing the new feature. Power BI February 2023 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI

 

@Anonymous From the article, my understanding is we would need to reformat our Custom Theme JSON files to conform with the new schema. I will be comparing my current custome theme to the formats shared in the announcement. 

 

@Anonymous : Please let us know if there will be additional fixes from the Power BI product team.

 

 

dparks2
Regular Visitor

Hi @Anonymous ,

 

We are having the same issue with errors when trying to import a custom JSON file that previously worked and which has had no edits.  How do I acquire an older version of Power BI to implement the suggested workaround?

Thanks,
dparks2

PrivateBI
New Member

You can find old versions of PowerBI here: https://learn.microsoft.com/en-us/power-bi/fundamentals/desktop-latest-update-archive?tabs=powerbi-d...

 

I had the same issue and reverted back to December 2022. Reloading the theme worked perfectly after that.