Pragmatic Works Nerd News

Saving a Power BI Background Image to your JSON Theme File

Written by Allison Gonzalez | Jan 06, 2025

In this tutorial, you’ll learn how to save a background image to your Power BI JSON theme file, ensuring that your custom report backgrounds are included every time you apply your theme. Perfect for Power BI designers who want to streamline the process of applying consistent branding across multiple reports.

 

Overview

When you create a theme in Power BI and save it as a JSON file, there’s no built-in way to include background images. Normally, you would have to manually add the background to each report. However, by editing the JSON file, you can embed the background image into the theme itself. This tutorial will guide you through the steps to add images to your theme using a Base64-encoded image in the JSON code.

Steps to Save a Power BI Background Image to JSON Theme

  1. Export Your Theme: In Power BI, go to the View ribbon, select your theme, and save it as a JSON file.
  2. Open the JSON File: Use a code editor like Visual Studio to open and format your JSON theme file for better readability.
  3. Convert Your Image to Base64: Use an online tool to convert your background image (JPEG, PNG, SVG, etc.) to Base64 format. This allows the image to be embedded directly into the JSON code.
  4. Edit the JSON Code: In the JSON file, locate the section for visual styles and backgrounds. Add the Base64-encoded image by specifying it in the correct format.
  5. Test and Verify: After editing and saving your theme, load it back into Power BI. Ensure that the background image is applied automatically to every page in your report.

Key Concepts Covered

  • Understanding how Power BI themes are saved as JSON files.
  • Formatting JSON code for readability and easy editing.
  • Embedding images into JSON files using Base64 encoding.
  • Editing Power BI theme files to include custom background images.
  • Applying and testing the modified theme in Power BI to ensure background images load properly across multiple report pages.

Tools and Resources

  • Code editor like Visual Studio for editing JSON files.
  • Online Base64 image encoder tools to convert images to Base64 format.
  • Power BI to create and test your custom theme with background images.

Best Practices

  • Always back up your original JSON theme file before making edits.
  • Use clear, readable formatting for your JSON code to avoid errors.
  • Test your theme in a blank Power BI report before applying it to important reports.
  • Adjust transparency settings for your background image in the JSON code to ensure that the image does not obscure report visuals.

Conclusion

By embedding your background images into your Power BI JSON theme files, you can save time and ensure consistency across all your reports. While the process requires a few technical steps, it’s a simple and effective way to enhance your Power BI themes. If you’re interested in learning more about how to customize Power BI with JSON, let me know in the comments, and I’ll create a series of in-depth tutorials!

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power BI and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.