The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 is to design a single JSON theme that automatically adapts to all visuals, without the need for separate themes for each report or visual. The file should also support easy updates to the color palette. if I change the primary, secondary, and other color values within the file, those changes should automatically apply throughout the entire report, ensuring consistent and dynamic styling across all visuals.
Here are some specifics I need assistance with:
Universal Theme Application:
The JSON theme should apply to all visual types in Power BI (bar charts, pie charts, KPIs, waterfall charts, etc.). However, I want to ensure the theme adapts dynamically to each visual type. For example:
Gradient Effects & Customization:
I’m concerned about the application of gradient effects in visuals like pie charts and bar charts. For instance, pie charts shouldn’t have gradient effects, but bar charts with many bars could benefit from it. I want the theme to apply these effects conditionally, based on the visual’s context. Is there a way to apply a gradient effect to only certain charts (like bar charts with a larger number of bars) and avoid them where inappropriate (like in pie charts)?
Single JSON File for All Reports:
I want to create a reusable, plug-and-play JSON theme that can be applied to any Power BI report and automatically adapt to the included visuals (bar charts, waterfall charts, pie charts, KPIs, etc.) without manual adjustments. The theme should cover all possible chart types and apply consistently, regardless of the data in the report.
Scalability and Efficiency:
My challenge is ensuring that the JSON file doesn’t become overly complex or large to the point where it’s difficult to manage or apply across different reports. How can I structure this theme efficiently while ensuring it works across all charts without performance issues or missing any key visuals?
Reference GitHub Repo:
I’ve come across a GitHub repository that might be useful for reference: Power BI Theme Templates by deldersveld. I’m looking for guidance on how to use this as a reference or integrate its templates into my approach for generating a comprehensive JSON theme.
Can anyone share their experiences or insights on how to create a universal theme that can be applied seamlessly to various Power BI reports with diverse visual types? Any tips on managing the gradient effects, theme customization, and ensuring scalability would be greatly appreciated!
Looking forward to your thoughts!
Solved! Go to Solution.
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.
Adding to what @Anonymous said, check this post from @Greg_Deckler. It's a great source and definitely helped me to find a tool that helps you with the JSON creation.
Proud to be a Super User!
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.
Proud to be a Super User!