The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
Multiple fields in my JSON theme script are not carrying over to my Power BI file. I am working with a clustered bar chart just to practice getting my theme up and running. The fields that are not applying are:
1) Gridlines
2) X axis data labels (but the title shows)
3) Legend position (I have it as Bottom Center but only the word Bottom works)
4) Data labels (the decimal places are always in the trillions when really, I don't want any decimal places)
I have used this resource throughout creating the JSON theme.
The issue is that my script is correct but when applied to the BI report it does not change some of the fields that should be changed. For example my legend script is:
"legend": [{ "show": true, "position": "Bottom", "showTitle": false, "titleText": "", "fontColor": "#666666", "fontSize": 10, "fontFamily": "Segoe UI" }]
Every part of this script works and changes the BI report when applied, EXCEPT the position; when the position says "Bottom Center" it doesn't apply (of course I can always apply it manually within Power BI). When the positions says "Bottom" or "Top" in the scripts, it applies to the report.
Based off of this resource, "Bottom Center" should be able to apply to the report.
This issue--some script comands will apply while others won't in the same format according to this resource--occurs with other fields (noted in my first post), notably "Labels":
"labels": [{ "show": false, "labelColor":"#777777", "labelDisplayUnits": "Auto", "labelPrecision": 0, "labelPosition": "Auto", "fontSize": 9, "fontFamily":"DIN", "enableBackground": false, "backgroundColor": { "solid": { "color": "#0928DD"}}, "backgroundTransparency": 30 }]
With the code the "labelPrecision" is set to 0, meaning that the data labels occuring beside tmy data columns should have no decimals points. However, when I apply the theme, the report sets the precision to "Trillions". Again, this field has elements that should be able to be controlled in a JSON theme file but are not controlled, or are changed to something completely unspecified within the BI report.
To me this could mean:
1) Maybe there is something in my code that is globally over-riding other parts of my script so that they are ignored when I try to apply the theme.
(but I keep checking so I don't think this is the case).
OR
2) Maybe some of the syntax listed in this resource are incorrect and therefore when I try to apply the script to the report Power BI doesn't recognize them and uses it's defult settings instead.
OR
3) Maybe Power BI requires some of these fields to be itemized globally within the JSON file rather than noted under the visual element's properties part of the script; so when I apply the theme Power BI doesn't "see" my command because it isn't in the right place in the script.
Any other thoughts or theories as to what I'm doing wrong? It is becoming very limiting for the amount of control I want over the report using the JSON theme.
I had to use "bottomcenter" and then at times I had to recreate the graph, but when I did it the legend was bottom center.
I've just tried "position": "TopCenter" and it worked
Hi @austrich
Here are some articles for you:
https://docs.microsoft.com/en-us/power-bi/desktop-report-themes
https://feathersanalytics.com/power-bi-custom-report-theme/
Regards,
Cherie
Hello,
Multiple fields in my JSON theme script are not carrying over to my Power BI file. I am working with a clustered bar chart just to practice getting my theme up and running. The fields that are not applying are:
1) Gridlines
2) X axis data labels (but the title shows)
3) Legend position (I have it as Bottom Center but only the word Bottom works)
4) Data labels (the decimal places are always in the trillions when really, I don't want any decimal places)
have you tried using barChart instead of clusterBarChart? this worked for me
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
139 | |
110 | |
107 | |
76 | |
62 |
User | Count |
---|---|
270 | |
129 | |
123 | |
100 | |
92 |