Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sabz13
New Member

Bespoke icon for conditional formatting

Hi team, I need to create new bespoke icons using images from our comms team. So, for example, when a team name is used in a graph instead of the 'name' being displayed the 'icon/image' is displayed instead.


I have looked through the different forms around customising icons etc but can't see one on using a bespoke icon, and a proper step by step ‘dummies guide’ to getting this into the Power BI icon drop down list (as shown below).

Or is there a better way to do it? A rule when the 'text' is used then use the corresponding ‘image’? Not sure how that would work??


NOTE: All bespoke icons from comms are currently PNG files.

 

 

Sabz13_0-1697577640341.png

 

1 REPLY 1
OwenAuger
Super User
Super User

Hi @Sabz13 

Here are some suggested answers:

 

Note 1: I have attached a JSON file containing 4 custom icons, and a PBIX using those icons.

Note 2: In code blocks, the forum converts colon characters to &colon. If you are copying the code, please change these back to actual colon characters 🙂

 

1. Adding Icons to Theme

 

{
"name": "Custom Icons",
  "icons": {
    "Checkers": {
      "description": "My Grey Checkers",
      "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII"
    }
  }
}

 

 

2. Applying these icons in Power BI Desktop

  • After adding the Theme in Power BI Desktop, the icons are visible in the drop-down list in the Icon Conditional Formatting dialog box.
  • Note that the "description" shows on hover.
  • You can also create a measure that returns the icon's name (e.g. "Pennywise" in my example), and select this measure when using Format Style = Field Value.
  • In my PBIX, I added an "Icon" column to my table which contains valid icon names as text, and created a Selected Icon measure which retrieves the current text value from this column. As long as the value returned by the measure is a valid icon name, this will work fine.

 

Selected Icon = 
SELECTEDVALUE ( Score[Icon] )

 

 

Some screenshots below:

 

Icon drop-down menu:

OwenAuger_0-1697618129870.png

Field value method with measure [Selected Icon]

OwenAuger_1-1697618342729.png

Visual with conditional formatting using icons

OwenAuger_2-1697618565951.png

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.