March is an exciting month, and with this release of Power BI we have been given some long asked for features. One such feature is the ability to import a color theme. The color theme defines the starting colors for your visuals. Before the ability to import a theme one would have to first define each color that they want to use in a Power BI report by changing each visual to have the correct color scheme. Color themes are useful when trying to make a dashboard and you want to use colors that resemble a company’s product or logo. Alright, let’s get started and make and add our own color theme to a report.
Begin by opening up Power BI Desktop. Make sure you have the latest version of Power BI Desktop, you can download the latest version here. The import color theme feature is available in the March 2017 release.
On the Home ribbon click the Enter Data button. Enter the following table of data and name the table Data.
Product | Value |
Item1 | 20 |
Item2 | 25 |
Item3 | 15 |
Item4 | 40 |
The Create Table should look similar to the following. Click the Load button to proceed.
Power BI will load the data to memory and the Fields pane will reveal our newly created columns. Add the Stacked Column Chart on the report page and appropriate fields shown in the image below. You will notice that the default colors are automatically overlaid onto our visual when we add the Product to the Legend visual field.
Next, let’s take a peek at the standard colors that are offered by default from Power BI. Click on the Paint Roller found in the Visualizations pane. Then expand the data field labeled Data colors. Under Item1 click the little triangle. This will expose the current color scheme that is loaded.
Now we will load the new color theme. But before we can load the color theme we have to generate the color theme first. The color theme has some requirements. First the color theme must be written as a JSON file and must adhere to the JSON format. For developers this will be a very simple google search to accomplish this. However, I know there are some out there that do not enjoy doing development work. So, in a PowerBI.Tips first, I have developed a custom tool to make the color theme generation super simple.
Introducing the PowerBI.Tips Color Theme Generator (CTG) to help Power BI users create quick and easy JSON code files to input into Power BI for the color themes. Not everyone has a coding background, and though there will be tutorials and examples of how to set up the JSON, if you aren’t familiar with the language a small typo could have you spending precious time troubleshooting the issue.
update 3/15/17: The Advanced Theme Generator has been released. Find the tool here.
Click the following link to open up the PowerBI.Tips Color Theme Generator in a different Browser window. Once the browser loads the Color Theme Generator follow the instructions listed at the top of the page to select your colors. The only required fields are the Name, and at least one color. For this tutorial I selected a number of nice pastel colors. Click the Download Color Theme button to download the JSON file that we will use in Power BI.
Note: The Generator was tested on Google Chrome. Also, clicking the Download button will download the JSON file to your browser’s default location. You will need to know this file location to load the file into Power BI Desktop.
Head back over to Power BI Desktop. On the Home ribbon click the button labeled Switch Theme. Then click Import Theme.
Note: If you want to remove your custom theme you will click on the Switch Theme, then click on the Default Theme. The normal power BI colors will be restored.
Navigate to where your browser downloaded the file. Select the file labeled PowerBI-Tips Color Theme. Click Open to load the theme.
PowerBI will prompt a message letting you know everything loaded correctly. Click Close to see the new theme applied to our visual.
We can now see our custom theme by clicking on the Paint Roller found in the Visualizations pane. Then expand the data field labeled Data colors. Under Item1 click the little triangle.
Tada, now we have a custom color scheme that we create and loaded. Also, now that we the JSON file you can modify the file and keep it for future projects.
Thanks for following along. If you liked this tutorial please be sure to share. Also if you want to know more about me you can visit my About page and follow me on twitter or Linkedin for updates.
Awesome, will try it out today
Awesome this is in!!!
Btw. I like modifying the default slightly…
this should be it if someone needs it:
{
“name”:”BiStandard”,
“dataColors”:[“#01B8AA”, “#374649”, “#FD625E”, “#F2C80F”, “#5F6B6D”, “#8AD4EB”, “#FE9666”, “#A66999”, “#3599B8”, “#DFBFBF”, “#4AC5BB”, “#5F6B6D”],
“background”:”#FFFFFF”,
“foreground”:”#A6A6A6″,
“tableAccent”:”#FAFAFA”
}
what is the code to change the widget title’s font size and type?
I have tried my hardest to figure out how to modify these settings, at this time this is not available, to see all the features that I have found that work visit: https://powerbi.tips/tools/report-theme-generator-v3/
more visuals coming soon.
Hi I cannot see the import theme option. What can i do?
Double check to make sure you have the latest installation of Power BI Desktop. Download the latest build from the following location: https://powerbi.microsoft.com/en-us/desktop/
I also do not see this option, even after downloading the latest June 2017 release. I don’t understand why the option isn’t present.
Make sure you have turned on this preview feature. It is found under File -> Options and Settings -> Options -> Preview Features -> Custom Report Themes. Make sure this box is checked. Click OK to apply the setting.
I like this feature.
Somewhere to share these (similar to custom visuals) would be nice so we can try other users colour schemes
Great Idea, I am working on a solution that might meet that need. Hang tight and keep reading the blog, you may see a solution for this.
Microsoft also has a color themes gallery that you can use. https://community.powerbi.com/t5/Themes-Gallery/bd-p/ThemesGallery
Hi Is there any chance to import theme from published report.
Great question, there is no method to extract a theme from a current report. You can only import the color theme and remove the color theme. If you have made your color theme using the Advanced Color Theme Generator you will need to save the .json file that you created for later reuse.
Color Theme Generator has 12 color boxes but Power BI seems to accept only 6 with 2 defaults (White & Black). What are the rest for?
The program only shows you 6 colors. You can add many, many more colors using JSON. See the end of this video where I added 50 colors to the JSON Theme. Power BI still uses more than the standard 6. https://youtu.be/57hiVsfp6X4?t=2716
I can’t really have the Power BI color palette show more than the 8 * 6 = 48 colors though right?
I basically created a custom theme with the 2 default + 5 other colors. I was hoping to use the 8th column of colors to show up a bunch of other colors that I frequently use.
That main idea is not so much to have a theme as such but to have all the colors that I frequently use available in the Power BI color palette.
Is there a way to do that?
ah I see what your trying to do. Sorry, there is not a way to increase the size of the color pallet beyond what is already given. Another option for styling your visuals would be to create a custom report theme. This way you could style each visual prior to using them all on the report pages.
Here is a tool that developed to get you started in the right direction:
https://powerbi.tips/tools/report-theme-generator-v3/
here is the documentation the report themes:
https://docs.microsoft.com/en-us/power-bi/desktop-report-themes
I have a quick question. When you have 50 colors in the theme, how do you choose them while the pallet only shows 8?
That is a great question. From my understanding you are not able to select anything more than the top 8. That is a tool limitation. If you are using 50 colors, that means you could use any visual with 50 different color changes. But, sadly, we are for now limited to only 8 colors
IS there a work around for the legend changing to the default color when a single value is selected in a filter?
I have not found a work around at this time. I would try this same question on the Power BI community as they might have a wider experience knowledge base and might have a solution. The community forum can be found here: https://community.powerbi.com/
Error message:
Unable to Open Document
… Corrupt or invalid report file
make sure you power BI desktop version is on the latest version. Also, if you have modified the file, there is a chance that the JSON structure has been altered. Try Opening the file in Visual Studio Code. This tool will help you visualize the code, and debug syntax issues.
I’m working in desktop and just updated to the June 2018 version. I don’t have that button in my Home ribbon. Has it moved or is there some setting I’m missing?
This setting is in preview. You will need to turn it on. To do this go to File -> Options & Settings -> Options -> Preview Features (from the left nav bar) -> Turn on Custom Report Themes.