Power Your Power BI with Custom Fonts

Microsoft Power BI is probably one of the most used applications for creating visual reports. Power BI supports multiple and diverse font families by default but to support your branding guidelines or to make it more appealing for the viewer, can add custom font families to it.

Assume that an organization utilizes Roboto font in all their visual solutions, branding, etc. Wishes their Power BI reports to follow that pattern and fit into the branding guidelines, but Roboto is not available by default. Then we need to implement some custom solutions.

Let’s get started,

Prerequisite

Custom Font Should exist in your local machine: The font which users wish to use in their report must exist in their local machine, Now the questions here are

How to check for the fonts to see if they exist or not

Open the Below mentioned folder location from File Explorer on your local machine

“C:\Windows\Fonts”

Then Searched for the custom font, if found then we are good to go else need to install the font first and then save it here in this location

How to install the font

Simply install the font from any browser, just need to make sure that it should have the following highlighted property, to check for this, open your downloaded file, and there you see these details on the top

Power BI Custom Font

Implementation

Under the View tab, choose to Save the current theme, so that you can edit the source JSON file directly.

Power BI Custom Font

Open the downloaded JSON theme file in Notepad/Notepad++ or Visual Studio, and you will see the current settings for your theme:

Power BI

{

“name”: “Custom”,

“textClasses”: {

“label”: { “fontFace”: “Arial” },

“callout”: { “fontFace”: “Arial” },

“title”: { “fontFace”: “Arial” },

“header”: { “fontFace”: “Arial” }

}

}

Now replace the current font with your custom font, for example Roboto, then the code will look like the below, save the file and close it.

{

“name”: “Roboto”,

“textClasses”: {

“label”: { “fontFace”: ” Roboto ” },

“callout”: { “fontFace”: ” Roboto ” },

“title”: { “fontFace”: ” Roboto ” },

“header”: { “fontFace”: ” Roboto ” }

}

}

Now open the report and browse the Update JSON file

Power BI custom font

You will see the changes now:

Power Bi

One more important thing to keep in mind: if you manually change the font of the visual once you open your .pbix file, BEFORE importing the theme, and then import the theme, changes will not be applied! I don’t know if it is a bug or what but that’s how it behaves

Workaround

Occasionally it might happen that even after importing the JSON file, font doesn’t get applied to all the visuals simultaneously. You might observe few visuals are unchanged. In such situations, we have a perfect workaround (note that custom fonts work perfectly fine for new visuals).

  • Create a new visual that has a layout similar to the visual where custom fonts are not applied
  • Select the visual and under the home tab, choose format painter
Power BI custom font
  • Use the brush to paint over a selection of text or graphics to apply the formatting. This only works once. To change the format of multiple selections in your document, you must first double-click Format Painter.
Power BI Custom Font

Follow Ignatiuz for more such interesting hands-on articles that can transform the way you work.

Leave a comment