Forum Discussion

chovatiya_parth's avatar
chovatiya_parth
Frequent Visitor
1 year ago
Solved

Creating a Universal JSON Theme for Power BI Reports

Hi Community, I'm working on creating a Power BI theme that can be universally applied to any report, regardless of the visual types (e.g., bar charts, waterfall charts, KPIs, pie charts). The goal ...
  • Anonymous's avatar
    Anonymous
    1 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.