Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I'm trying to write my own custom theme JSON file base on samples I have downloaded from this page: https://docs.microsoft.com/en-us/power-bi/desktop-report-themes
and this very handy git repo: https://github.com/deldersveld/PowerBI-ThemeTemplates
But I'm piecing elements together and getting errors a lot of the time. Probably because I don't understand how everything fits together, which is probablydue to lack of sample in the first page.
For example, I can have a secion like this:
"visualStyles": {
"*":
etc.
And I get that things under this seciton will apply to all elements. But then I aslo have this:
"page": {...}
and that is for formatting the pages.
So far, so good. But if I want to format all my cards, for example with a certain style that is different than the default, and I try to add this:
"card": {...}
It bombs out.
Why? Can I not have a "*" section and a "card" seciton both at the same level under "visualStyle" ? Or a "card" section and a "page" section at the same level?
Do certain sections need to come before others?
BTW, the first page referenced seems to not be taking comments 😞
Proud to be a Super User! | |
Solved! Go to Solution.
Hi ToddChitt,
It seems that you want to combine multiple visuals in the same json file and apply global setting, right? If so, I think you could try below
{"name":"My Theme", "visualStyles":{ "*":{ "*":{"*":[{"fontSize":12,"fontFamily":"Calibri, Cambria","color":{"solid":{}}}]}}, "pieChart":{"*":{"legend":[{"show":true,"showTitle":true,"labelColor":{"solid":{"color":"#75b2f0"}}}],"general":[{"responsive":true}]}}, "card":{"*":{"labels":[{"show":true,"color":{"solid":{"color":"#1c7ad9"}},"fontSize":20}]}}}}
You could use Report Theme Generator V3 this tool, to create json, when you set multiple visuals, you could click donwload button, it will ceate and download json file for you(you also could modify the file based on your requirement)
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi ToddChitt,
You said you can't use custom theme , right? Did you change something in JSON? If you download the json file from https://github.com/deldersveld/PowerBI-ThemeTemplates and import this in powerbi, will this work?
If you change the code in JSON, please inform me your JSON sample, I will test this in my environment.
Best Regards,
Zoe Zhi
Hello, and thanks for the reply. I used some of the samples at the Git site as a starting point. But those address single visuals at a time. I want to combine formatting for several into one file. Is there a sample somewhere that shows how to format the "visualStyles": {...} section where you have multiple sub-sctions for different chart types?
The site by MS is woefully inadequate in this regard, and, it does not seem to be taking any new comments 😞
I have boiled down my JSON theme to the following that does not work. If I remove either the "card":{...} section OR the "page": {...} section, then it works fine. But the two together don't.
Am I missing a delimiter between the two secitons or something stupid like that?
{
"name": "CardTemplate",
"visualStyles":
{
"card":
{
"*":
{
"border":
[
{
"show": true,
"color": { "solid": { "color": "#062b60"}}
}
]
}
}
"page": {
"*": {
"background": [{
"color": { "solid": { "color": "#062b60" } },
"transparency": 50
}],
"outspace": [{
"color": { "solid": { "color": "#062b60" } },
"transparency": 50
}]
}
}
}
}
Proud to be a Super User! | |
Hi ToddChitt,
It seems that you want to combine multiple visuals in the same json file and apply global setting, right? If so, I think you could try below
{"name":"My Theme", "visualStyles":{ "*":{ "*":{"*":[{"fontSize":12,"fontFamily":"Calibri, Cambria","color":{"solid":{}}}]}}, "pieChart":{"*":{"legend":[{"show":true,"showTitle":true,"labelColor":{"solid":{"color":"#75b2f0"}}}],"general":[{"responsive":true}]}}, "card":{"*":{"labels":[{"show":true,"color":{"solid":{"color":"#1c7ad9"}},"fontSize":20}]}}}}
You could use Report Theme Generator V3 this tool, to create json, when you set multiple visuals, you could click donwload button, it will ceate and download json file for you(you also could modify the file based on your requirement)
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@daxThanks for the tip. Not sure I would use the Theme generator at this point. But I did see something in your sample that caught my eye:
There is a comma between sections, like just before the "card":{...} section.
So for me, adding the comma did the trick.
Cheers.
Proud to be a Super User! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |