Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I am creating a JSON file to customize the theme in Power BI. I used the clustered column chart as an example and was able to change the colors, X and Y axes (font, size and color). However, I am having difficulty modifying the data label. I will share my JSON file as I believe I am configuring something wrong, or does Power BI not support changing the data label via JSON?
Json:
{
"name": "Custom Color Palette",
"dataColors": [
"#01335C",
"#467BED",
"#FF6564",
"#FFC150",
"#1AB2AE",
"#74e8ee",
"#F0ECEE",
"#808384"
],
"background": "#FFFFFF",
"foreground": "#000000",
"tableAccent": "#467BED",
"visualStyles": {
"clusteredColumnChart": {
"*": {
"categoryAxis": [
{
"labelColor": {"solid": {"color": "#000000"}},
"fontFamily": "Segoe UI",
"fontSize": 20,
"title": {
"fontFamily": "Segoe UI",
"fontSize": 20,
"color": {"solid": {"color": "#000000"}}
}
}
],
"valueAxis": [
{
"labelColor": {"solid": {"color": "#000000"}},
"fontFamily": "Segoe UI",
"fontSize": 20,
"titleFontFamily": "Segoe UI",
"titleFontSize": 20,
"titleColor": {"solid": {"color": "#000000"}}
}
],
"dataLabel": {
"show": true,
"fontSize": 14,
"fontFamily": "Segoe UI",
"color": {"solid": {"color": "#FF6564"}},
"displayUnits": "None",
"labelPosition": "InsideEnd"
}
}
}
}
}
Hi @Iguinrj,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @Iguinrj,
May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Iguinrj,
Thank you for reaching out to the Microsoft Fabric Forum Community.
I have reproduced your scenario using my sample data and successfully achieved the expected output. The data labels, axis formatting, and colors were correctly applied using a JSON theme.
I noticed a small issue in your JSON file where the data label formatting was not applying correctly. To fix this, I made the following changes:
Here is the corrected JSON file:
{
"name": "Custom Color Palette",
"dataColors": [
"#01335C",
"#467BED",
"#FF6564",
"#FFC150",
"#1AB2AE",
"#74e8ee",
"#F0ECEE",
"#808384"
],
"background": "#FFFFFF",
"foreground": "#000000",
"tableAccent": "#467BED",
"visualStyles": {
"clusteredColumnChart": {
"*": {
"categoryAxis": [
{
"labelColor": { "solid": { "color": "#000000" } },
"fontFamily": "Segoe UI",
"fontSize": 20,
"title": {
"fontFamily": "Segoe UI",
"fontSize": 20,
"color": { "solid": { "color": "#000000" } }
}
}
],
"valueAxis": [
{
"labelColor": { "solid": { "color": "#000000" } },
"fontFamily": "Segoe UI",
"fontSize": 20,
"titleFontFamily": "Segoe UI",
"titleFontSize": 20,
"titleColor": { "solid": { "color": "#000000" } }
}
],
"labels": [
{
"show": true,
"fontSize": 14,
"fontFamily": "Segoe UI",
"color": { "solid": { "color": "#FF6564" } },
"displayUnits": "None",
"labelPosition": "InsideEnd"
}
]
}
}
}
}
I have also attached .pbix file for your reference. Please check it out.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Thanks for the support. However, the font size and label position are not working. I can't attach my template here. I also wanted to create the title and subtitle changes for the visual in JSON. Is it possible to do this via JSON as well?
Hi @Iguinrj,
Thanks for the follow-up.
Yes, it is possible to configure both the title and subtitle of a visual using a JSON theme in Power BI. These settings can be applied under the visualStyles section by targeting the visual type (e.g., clusteredColumnChart) and specifying the formatting options for "title" and "subTitle".
I trust this information proves useful. If it does, kindly “Accept as solution” and give it a 'Kudos' to help others locate it easily.
Thank you.
Hi @Iguinrj,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.