This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hello,
I am trying to create a JSON template for our organization. I'm having a little difficulty understanding all the aspects of each visual. What if I wanted to set certain categories within my categoryAxis to distinct colors instead of them all being defaulted to the same color like in a bar chart? Specifically, if I have countries as my category how would I set US to green and Canada to red for example. Would it be in the "dataPoint" section where I have it now and the syntax might be wrong? Any suggestions appreciated!
Here is what I have so far:
"barChart": {
"*": {
"general": [
{
"responsive": true
}
],
"legend": [
{
"show": false,
"position": "Top",
"showTitle": true,
"titleText": "",
"labelColor": {
"solid": {
"color": "#01B8AA"
}
},
"fontFamily": "Segoe UI",
"fontSize": 10
}
],
"categoryAxis": [
{
"show": true,
"position": "Left",
"labelColor": {
"solid": {
"color": "#FFFFFF"
}
},
"fontSize": 11,
"fontFamily": "Segoe UI",
"preferredCategoryWidth": 30,
"maxMarginFactor": 28,
"innerPadding": 22,
"showAxisTitle": false,
"axisStyle": "showTitleOnly",
"titleColor": {
"solid": {
"color": "#FFFFFF"
}
},
"titleText": "",
"titleFontSize": 8,
"titleFontFamily": "Segoe UI"
}
],
"valueAxis": [
{
"show": true,
"axisScale": "Linear",
"start": "auto",
"end": "auto",
"labelColor": {
"solid": {
"color": "#FFFFFF"
}
},
"fontSize": 11,
"fontFamily": "Segoe UI",
"labelDisplayUnits": "0",
"labelPrecision": "Millions",
"showAxisTitle": false,
"axisStyle": "showTitleOnly",
"titleColor": {
"solid": {
"color": "FFFFFF"
}
},
"titleText": "",
"titleFontSize": 11,
"titleFontFamily": "Segoe UI",
"gridlineShow": true,
"gridlineColor": {
"solid": {
"color": "#999999"
}
},
"gridlineThickness": 1,
"gridlineStyle": "dotted"
}
],
"dataPoint": {
"defaultColor": {
"solid": {
"color": "#448822"
}
},
"United States": {
"solid": {
"color": "#FFFFFF"
}
}
},
"labels": [
{
"show": true,
"color": {
"solid": {
"color": "#EEEEEE"
}
},
"labelDisplayUnits": "auto",
"fontSize": 8,
"fontFamily": "Segoe UI",
"enableBackground": false,
"backgroundColor": {
"solid": {
"color": "#FFFFFF"
}
},
"backgroundTransparency": 0
}
],
"plotArea": [
{
"transparency": 0
}
]
}
}
Solved! Go to Solution.
Hi @Anonymous,
I am trying to create a JSON template for our organization. I'm having a little difficulty understanding all the aspects of each visual. What if I wanted to set certain categories within my categoryAxis to distinct colors instead of them all being defaulted to the same color like in a bar chart? Specifically, if I have countries as my category how would I set US to green and Canada to red for example. Would it be in the "dataPoint" section where I have it now and the syntax might be wrong? Any suggestions appreciated!
By my tests, I'm afraid we may not achieve that in Power BI Report theme file currently.
Your requirement seems like conditional formatting, you could vote your idea in Power BI ideas Forum and add your comments there to improve Power BI and make this feature coming sooner.
As an workaround, you could set your country in an order as the color order in your JSON filer.
Best Regards,
Cherry
Hi @Anonymous,
I am trying to create a JSON template for our organization. I'm having a little difficulty understanding all the aspects of each visual. What if I wanted to set certain categories within my categoryAxis to distinct colors instead of them all being defaulted to the same color like in a bar chart? Specifically, if I have countries as my category how would I set US to green and Canada to red for example. Would it be in the "dataPoint" section where I have it now and the syntax might be wrong? Any suggestions appreciated!
By my tests, I'm afraid we may not achieve that in Power BI Report theme file currently.
Your requirement seems like conditional formatting, you could vote your idea in Power BI ideas Forum and add your comments there to improve Power BI and make this feature coming sooner.
As an workaround, you could set your country in an order as the color order in your JSON filer.
Best Regards,
Cherry
Thank you very much! I hadn't thought of that solution. Until or when category specific formatting is availabe I will use this option!
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 31 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 55 | |
| 31 | |
| 24 | |
| 23 |