1. Modifying a theme
So far, in these exercises, we have used the default Power BI theme. Now, let's shake things up a bit. In the View ribbon menu, we can choose between a variety of light and dark themes. Innovate is an example of a dark theme.
This theme changes things like text, color and size, background colors, and the colors of bars. Changing the theme affects all pages in the report, as we can see when flipping to the Inspection Report page.
Let's switch to the Sunset theme.
The font sizes are smaller, and the Inspection Report and Overview pages look fine. I want to customize the theme, so in the drop-down menu, let's choose "Customize current theme" from the menu.
This brings up the name and color theme. This theme can be difficult for people with certain types of color vision deficiency to use. For example, people with tritanopia will struggle to differentiate colors 5 and 8, and people with deuteranopia will not be able to differentiate negative and positive sentiments. Let's fix sentiment by changing the positive color to #11D0A0, green-like but easy enough for everybody to distinguish from our red. We'll leave color eight alone for now.
Selecting the Text menu, we can see that our current theme does not support text formatting. Older Power BI themes didn't support this feature, but the fix is easy: update the theme.
Now we can change font sizes. For DataCamp courses, we like to set the General font size to 15 points, the Title to 15, the Cards and KPIs to 45, and the Tab headers to 15.
Let's also look at the Filter pane. Here, we can change various settings around how filters appear to users, including background color, font size, and transparency.
We can also change the settings on filter cards, both active and available. Let's apply these changes to our theme. We can export the theme as JSON by choosing "Save current theme."
I'll save this as demo.json. Let's open the JSON file up in Notepad and see what it includes.
The first array of values represents the data colors. Classic themes include many, but we only need eight, as that's what modern Power BI uses. Let's get rid of the rest, everything after #FFD86C.
We can make any changes to this theme in JSON, even for things we could not do in the customized themes menu. Let's rename the theme Demo Theme and change the eighth color to #E3E03D. That will make it easier for people with tritanopia to see while not preventing anybody else from being able to differentiate colors in the palette.
Let's save the file in Notepad and then return it to Power BI. Now I can select Browse for themes from the menu and import the updated theme.
After it imports successfully, I can customize the theme and see that the name and color eight have changed.
We can do much more with themes, but now it's your turn to practice customizing them.
2. Let's practice!