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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
boeschr
Frequent Visitor

Problem with custom theme (JSON)

Hi there

I have the following situation:

My customer already started building a report with several pages and many visuals. He also did some formatting on them using the format section in Power BI Desktop. Now we want to use another font and data colors to represent their corporate design also in the report. I started with a JSON-file and it works perfect for the data colors and the font family. Also font size and title font size seem to work fine.

Where I have problems is following:

  • percentageLabelprecision works only in 95% of the visuals
  • labelprecision does not impact the visuals
  • font size on card labels does not work

I see 2 possibilities:

  • there is an error in my JSON-file
  • or the imported JSON cannot overwrite all settings that my customer maybe made on top of a theme

What makes me think it could be second point: After I imported my JSON. I go to the card visual and revert the labe settings to default. Then it correctly jumps to the value from the JSON.

So my question:

  • What's the problem? Is it known?
  • Is my JSON correct or do I have to do it in another way to overrule existing settings?
  • What would be the best solution, given that we have several pages with many visuals?

Thanks for your help!

Here is my JSON (I already have some placeholder for visuals we might change in a next step):

{
"name":"My Desgin Template, 2021-10-15",
"dataColors": [
"#E8531A",
"#70BDDC",
"#415EA1",
"#DABF3B",
"#588E5C",
"#9E292E",
"#8D310E",
"#277DA0"
],

"visualStyles":{
"*":{
"*":{
"*":[{
"fontFamily":"Arial Narrow",
"fontSize":8
}],
"labels":[{
"show":true,
"percentageLabelPrecision":1,
"LabelPrecision":1
}],
"title":[{
"show":true,
"fontSize":12,
"alignment": "left"
}]
}
},
"card":{
"*":{
"labels":[{
"fontSize":24
}]
}
},
"columnChart":{
"*":{
"labels":[{

}]
}
},
"hundredPercentStackedColumnChart":{
"*":{
"labels":[{

}]
}
},
"lineChart":{
"*":{
"labels":[{

}]
}
},
"pieChart":{
"*":{
"labels":[{

}]
}
},
"slicer":{
"*":{
"labels":[{

}]
}
},
"tableEX":{
"*":{
"labels":[{

}]
}
},
"treemap":{
"*":{
"labels":[{

}]
}
}
}
}

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@boeschr 

 

You are correct - JSON themes do not overwrite custom formatting options. You'll have Revert everything to default formatting if you want it to use the themes: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes#situations-when-repor... 

 

Good news is, you can use the Format Painter to copy formatting for many visuals (especially those of the same type).

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

4 REPLIES 4
boeschr
Frequent Visitor

@AllisonKennedy 

 

Thanks for your answer. Is there a way to revert everything to default toghether? Or do i need to do this for every single visual and for every single format the customer changed? Or is your suggestion that I revert everything for one visual and then use the format painter to apply the reverted format to all visuals of the same type?

 

@boeschr Unfortunately there's no way (that I know of) to revert all to default. I do know a lot, but definitely not everything, but from my quick web search I can't find anyone with a better solution.

 

There is an idea you could upvote: https://ideas.powerbi.com/ideas/idea/?ideaid=22249dc4-0034-eb11-8441-281878bda85b 

 

Format painter is the quickest solution I can think of in the meantime.

 

Trick is really to teach people about themes early on so they don't run into this issue I guess.....


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy 

 

Thanks. I upvoted the linked idea 👍

I think it is easy when you start from scratch, but my customer had already started.

AllisonKennedy
Super User
Super User

@boeschr 

 

You are correct - JSON themes do not overwrite custom formatting options. You'll have Revert everything to default formatting if you want it to use the themes: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes#situations-when-repor... 

 

Good news is, you can use the Format Painter to copy formatting for many visuals (especially those of the same type).

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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