Forum Discussion
Power BI Desktop Theme Import Error: JSON Syntax Invalid or Invalid Top-Level Property
- 9 months ago
Hi ShoyaY,
Happy to hear this ☺️❤️
So the issue with pie chart and bar chart data labels you are facing is a common one, they often require more specific targeting in the JSON....So could you try this JSON structure that specifically targets data labels for pie charts and bar charts :
{
"name": "Noto Sans JP Complete Theme",
"textClasses": {
"callout": { "fontFace": "Noto Sans JP" },
"title": { "fontFace": "Noto Sans JP" },
"header": { "fontFace": "Noto Sans JP" },
"label": { "fontFace": "Noto Sans JP" }
},
"visualStyles": {
"*": {
"*": {
"*": [{
"fontFamily": "Noto Sans JP",
"fontSize": 10
}],
"title": [{
"fontFamily": "Noto Sans JP",
"fontSize": 12
}],
"labels": [{
"fontFamily": "Noto Sans JP",
"show": true
}]
}
},
"columnChart": {
"*": {
"dataLabels": [{
"fontFamily": "Noto Sans JP",
"color": "#000000",
"show": true
}],
"legend": [{
"fontFamily": "Noto Sans JP"
}]
}
},
"barChart": {
"*": {
"dataLabels": [{
"fontFamily": "Noto Sans JP",
"color": "#000000",
"show": true
}],
"legend": [{
"fontFamily": "Noto Sans JP"
}]
}
},
"pieChart": {
"*": {
"dataLabels": [{
"fontFamily": "Noto Sans JP",
"color": "#000000",
"show": true,
"categoryLabel": {
"fontFamily": "Noto Sans JP",
"show": true
},
"value": {
"fontFamily": "Noto Sans JP",
"show": true
},
"percentage": {
"fontFamily": "Noto Sans JP",
"show": true
}
}],
"legend": [{
"fontFamily": "Noto Sans JP"
}]
}
},
"donutChart": {
"*": {
"dataLabels": [{
"fontFamily": "Noto Sans JP",
"color": "#000000",
"show": true,
"categoryLabel": {
"fontFamily": "Noto Sans JP",
"show": true
},
"value": {
"fontFamily": "Noto Sans JP",
"show": true
},
"percentage": {
"fontFamily": "Noto Sans JP",
"show": true
}
}]
}
}
}
}
If the above JSON still does not work for data labels, try these additional approaches:
- Reset Visual Formatting First
Select your pie/bar chart
Go to Format pane → Data labels
- Click Reset to default (if available)
Then reapply your theme
If the theme still doesn't catch data labels, you can:
Apply the theme first
Then manually set data label fonts in the Format pane
Use Format Painter to copy these settings to other similar visuals
Try this more explicit structure for pie charts:
"pieChart": {
"*": {
"dataLabels": [{
"fontFamily": "Noto Sans JP",
"show": true,
"labelStyle": {
"fontFamily": "Noto Sans JP"
}
}]
}
}
Important Notes you should Know it:
- Some data label properties might not be fully theme able due to Power BI limitations
- If you previously manually formatted data labels the theme won't override them until you reset to default
- Some visual types (especially custom visuals) may not respect all theme settings
Let me know how this works!😀❤️
Hi Ahmed-Elfeel ,
I wanted to provide an update and express my sincere gratitude for your invaluable help!
All the issues are now resolved, and my custom font (‘Noto Sans JP’) is successfully applied to all text elements in my Power BI reports, including data labels and legends!
The key to the final solution was combining your modified JSON structure (which places dataLabels and legend under specific visual types) with an additional step:
- I imported the theme JSON file you provided (or a slightly extended version of it, including pieChart settings). This part worked perfectly, and the theme imported without any errors.
- For any text elements that did not immediately update to ‘Noto Sans JP’ after importing the theme (e.g., data labels on pie/bar charts), I found that using the “Reset to default” option in the visual formatting pane for that specific element caused the ‘Noto Sans JP’ font to be applied correctly.
This confirms that the theme was indeed loaded with the correct font settings, but some existing visual elements needed to be explicitly reset to adhere to the new theme.
Now, all my text boxes, table visuals, bar chart axis values, pie chart legends, and most importantly, data labels on bar charts and pie charts are correctly displaying ‘Noto Sans JP’.
Thank you again so much for your persistent support and excellent guidance. Your insights on placing dataLabels and legend under specific visual types were crucial, and the combined approach (import + reset to default) has finally led to a complete solution!
I would be happy to mark your initial helpful post as the solution.
- Ahmed-Elfeel9 months agoSuper User
- Ahmed-Elfeel9 months agoSuper User
Hi ShoyaY,
Mark the reply that has solution not my request solution reply to help other peopleto find it *You can mark more than one reply) i hope you understand