Forum Discussion
Creating a Universal JSON Theme for Power BI Reports
- Anonymous1 year ago
Hi, chovatiya_parth
Thanks for reaching out to the Microsoft fabric community forum.Regarding the issue you raised, my solution is as follows:
1.First, I must say that the GitHub link you shared is extremely useful and greatly beneficial to our community's development. Thank you for sharing it.
2.Secondly, regarding your first and third questions, I think they can be combined into one. Power BI supports creating and applying custom themes through JSON files. You can use JSON files to define the colors and styles of different visual objects, including pie charts, bar charts, KPIs, etc. Once you load the JSON file, it can be automatically applied. Here is a screenshot of the relevant documentation:
3.Next, regarding your fourth question, you can divide the theme file into multiple modules, each focusing on a specific type of visual object. This makes it easier to manage and update each module without affecting the entire theme file. Use wildcards (such as *) in the JSON file to apply common style settings. This can reduce duplicate code and ensure consistency. This is mentioned in the screenshot above.
4.Then, regarding your second question: JSON theme files themselves do not support complex conditional logic. Therefore, I suggest manually using custom functions in visual objects to achieve this requirement later on.
5.Finally, for how to apply JSON, please refer to the screenshot of the official documentation:
For more details, please refer to:
Use report themes in Power BI Desktop - Power BI | Microsoft Learn
Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Thanks for your detailed response and guidance on creating a universal theme for Power BI reports. I appreciate the references to the official documentation and the usefulness of the GitHub link I shared.
However, I must admit that I'm struggling to implement the JSON file due to my limited knowledge of JSON. I'm finding it challenging to create a single file that includes all the visual themes, as I'm facing errors in the code.
Could you please help me create a universal JSON file that encompasses all the visuals' themes? That would be a huge help to me, and I'm sure it would also benefit the entire community.
I am looking forward to your response and potential collaboration on this.
Best regards,
Parth
chovatiya_parth Use the UI from this link to set up your theme. You can even configure the global properties. Once you are done, click on download JSON file.