Using enterprise or custom fonts in Power BI

October 17, 2020
Denis Selimovic
Power BIcomment 3Created with Sketch Beta.24 comments

This post is also available in: German

Many companies are trying to achieve a consistent appearance and have corresponding or Corporate Identity / Corporate Design (CI/CD) guidelines.

As a reporting platform, Power BI should of course be no exception and fit into the corresponding specifications. However, this is often a big question mark, because at first glance there is no option to add additional fonts in Power BI. There is only a selection of standard fonts to choose from:

Standard Fonts in Power BI
Standard Fonts in Power BI

One would expect the topic CI/CD in the area of themes. So I would assume that you can adjust the fonts when you configure the current theme:

Customize theme in Power BI
Customize theme in Power BI

But you already guessed it, even there you cannot add fonts or change them to manually installed fonts:

Overview Fonts in Power BI
Overview Fonts in Power BI

Is it even possible to import a font into Power BI Desktop?

For this example, let’s first choose a font that should represent our company font. I intentionally choose a font called “MiddleEarth” that allows you to see the difference in the final report:

Font "MiddleEarth"
Font “MiddleEarth”

Then of course the question comes up whether it is even possible to add a custom font in Power BI Desktop or Power BI Service. The answer is yes, this is also possible.

As an example we want to display the following report in MiddleEarth font:

Report to be customized with a user-defined font
Report to be customized with a user-defined font

User defined font via Theme File

For this we have to adjust the new font directly in the theme file we are using. If our report has a default theme, we have to export the theme file first. Important to note, Power BI only exports changes to the theme. So you should change all fonts in the theme accordingly.

So we go back to the configuration of the current theme:

Customize theme in Power BI
Customize theme in Power BI

In the Text options, we change the font family in all categories (General, Title, etc.), for example to “Arial”:

Change the theme font in Power BI to Arial
Change the theme font to Arial

After that we have to save the theme as a JSON file. We do this using “Save current theme”:

Save current design
Save current design

We now search for this exported JSON file in Windows Explorer and open it with Notepad:

Exported theme JSON file
Exported theme JSON file

In the file we replaced all appearances of our just defined font, here “Arial”…

The existing font in the theme JSON file
The existing font in the theme JSON file

… with our chosen font “MiddleEarth” and save the JSON file:

The changed font in the theme JSON file
The changed font in the theme JSON file

In Power BI we now have to load the new design via “Browse for themes”:

Loading a theme file
Loading a theme file

We receive a message that the theme has been imported:

Theme was imported
Theme was imported

Afterwards the desired font appears in the report:

Power BI Report with changed font
Power BI Report with changed font

The font is now also available for all font options in Power BI:

Custom font is now available in Power BI
Custom font is now available in Power BI

Custom font on Power BI service

That Power BI can access locally installed fonts is a good start, but what about the reports on powerbi.com?

For this we simply publish the file on the Power BI service and see that the font is also visible there:

Custom font also works in browser on Power BI service
Custom font also works in browser on Power BI service

Restriction: font must be installed locally

However, there is one restriction. In the Power BI file as well as on the website (Power BI Service) the user-defined font will only be displayed if it is installed locally.

If the PC has not installed the font, the font cannot be displayed. The same applies to the Power BI App.

If we look at the HTML or CSS code for the opened report on the Power BI service in the browser, we see that the value inside our JSON file is simply used as the value for the font:

Custom font is also addressed in the CSS file of Power BI
Custom font is also addressed in the CSS file of Power BI

This means the browser requests the font “MiddleEarth” from the file system. If the font is not found, for example because it is not installed, it cannot be displayed and a fallback font will be displayed.

Conclusion

For companies that for example can ensure that their custom font is installed on all computers, this is a good opportunity to integrate their own design guidelines. But as soon as you have a broader audience, where you cannot control the installed fonts, the possibilities are very fast limited.