Conditional Formatting Using Icons In Power BI

Today Microsoft announced that it is now supporting icon sets to be used for conditional formatting in Power BI.  This feature has been available in Excel, like forever, and it great to see it available now in Power BI.

Set Up Power BI Conditional Formatting Using Icons

I have a number of measures in my Power BI Workbook to demonstrate the new icons as shown below.

Total Sales = SUM(Sales[ExtendedAmount])
Total Sales Prior Year = CALCULATE([Total Sales], DATEADD(Calendar[Date], -1, YEAR))
Change vs Prior Year = [Total Sales] - [Total Sales Prior Year]
% Change vs Prior Year = DIVIDE([Change vs Prior Year], [Total Sales Prior Year])

Power BI Online Training

The new icon feature is available under the conditional formatting menu.  Below I have a table using some of the measures above.  To add a Power BI conditional formatting icons set:

  1. Find the measure in the values section of the visual (a table or matrix)
  2. Click the menu next to the measure you want to apply conditional formatting.
  3. Select Conditional Formatting
  4. Select Icons

Conditional Formatting

The default settings are:

  1. Format by rules
  2. Based on the value in the selected measure
  3. And 3 icons are provided evenly split across the range of numbers returned by the measure.

Icons

With the default settings, this is what my table visual looks like

3 Visual

Note how the icons above have both shape and colour so you can differentiate between them even if you are colour blind.  This is best practice.

You can also change the default formatting to work on the hard coded number settings that you specify. In the example below I have changed the settings to work on absolute numbers instead of percentages (note the changes in the highlighted boxes).  Also note that I have set the minimum and maximum numbers shown as 1 and 2.  To do this, simply delete the value in these boxes.  Thanks to Chris Webb for finally helping me understand how this works.

4. Visual

This is what the table looks like with the above settings.

5. Table

Icon Sets for conditional formatting in Power BI

There is a large (but not unlimited) range of standard icons that can be selected from the icon menu, as shown below.

6. Icons

Icon Theme Files

If you are not satisfied with the standard icons, you can add your own icon sets using a theme file.    Here is a sample theme file that increases the default font size for visuals to 15pt (who doesn’t want that).  You will need to unzip the file and extract the json document.  I have added some sample icon SVG code I got from Microsoft to this file too, and also a static gif file that I found on the internet.  After I loaded the theme file, you can see the 3 new icons that have been added (shown below).  If you know how to write these SVG icons and/or can find other online icons, you can alter the JSON file to add new icons too.

7. Themes

I wrote about the theme files here if you would like more information.

Icon Measures

The last way (and may be most exciting) to add icons in Power BI is to write a measure.  Here is a sample that I got from Microsoft with a few small changes that I made myself.

8. Measures

  • Line 4 through 6 is SVG code that will draw a vector graphic as the icon
  • Line 7 is a named reference to one of the standard icons
  • Line 8 is a gif file that I found on the Internet

You can download the source code for this measure here.

Once you have a measure like this, you can change the conditional formatting as follows

9. Percent

Icons

If you know of any good, free icon sets that can be linked online for this purpose, please post the link in the comments below.

SVG code format

I don’t pretend to deeply understand the following code, but I was able to work out how to write an SVG icon using the following format.

This is the place holder/wrapper.  Just replace the SVG code in the location indicated

“data:image/svg+xml;utf8, <svg xmlns=’http://www.w3.org/2000/svg’ x=’0px’ y=’0px’ width=’100′ height=’100′ viewBox=’0 0 100 100′> PLACE YOUR SVG CODE HERE </svg>”

Here is some sample SVG code for a yellow circle with a green border .  Insert this in the space indicated above.

<circle cx=’50’ cy=’50’ r=’40’ stroke=’green’ stroke-width=’4′ fill=’yellow’ />

I just followed the learning from here https://www.w3schools.com/graphics/svg_intro.asp and used single quotes instead of double quotes.

Note:  A few people have reported issues using SVG code when publishing the PBIX online.  It seems this is related to the way some browsers interpret the # symbol for colour.  You should replace the # symbol with %23 in your SVG code to resolve this, then it should work online.

SVG Editor

This was the best online SVG editor I could find  https://editor.method.ac/

base64 code format

You can also encode an image to base64 format and embed that directly in the icon measure.  Here is an example.

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAvCAIAAAAAUC8xAAAACXBIWX
MAAC4jAAAuIwF4pT92AAACaUlEQVR42u2YP0hbQRzHtYoFBa0WFRGx0k6SgpkkONgtLoEumTp2cn
PrVHBxiWOHOHTQIXMlu0RcS6Crb3KyGV2ef+qf9vPytZenxuT9ufeK0B/H4+5y3Od+f+9IT88/lP
XRoZPZ8d9zEzHb/tTowkB/d96P6bH4MNM4ehcq+mnp5edPp86hG0NOvm4dv1vsTj2aecmiq48fXE
vya3OjC1UqntW/u/bkcm21E1VI17Z0oiaE7ERNDolcFwuivh98nhLytPHzemVZiJauiSJFvXn7Wl
UiClLuoZ1Xv4VNG1poJIWC85JOrMdcIRR1DiMiz/f3CAcvKJruCWXeiEj0u1nKmjhMA4lgWC8clr
JSNw0kpV+xQCclpAkE/JoSUuFKw7zpGdbLkGIB86YXPmSIIuiispM4EobqDo6kDIFnBnVRmhPwEz
Nc9W1tHhFpCrS/mWzBzVrQNphDI9GM46vOoR/K6RXBvGfqYsEM/YeIiGR3L/FXltladeBh2qgYmd
bWx4GQuurg4bmLrS+P7WWsyhr8+tgbKhCSLeAB9kprMy7i3JqBkBwZkr5KjMSRUk7hEJMXqxT8Rz
5tZC6Xy2Qy+Xy+XC77h6VSiWG1Ws38Ffp2kNqrUqnQqdfrfGHXajXYUDVfa0qj0bCGZDvD5guGIW
CoQlo2rNRC6DiOY5CC6SvhV2tIOU8kg8SqmjSGtamlfzspjYWxKp2kDOtH3gtgefeJ5GX8wh3kKX
oHye2YHFLvtBZye3xYY67GsG/wIPp5T5nmJbg7OXKLfPGs130zZfHfrbYNxKv+vtbfBVAPFheS4+
1l5+/wUpY/NGyhoiw9IhYAAAAASUVORK5CYII="

The pattern to use is to source the base64 code.  I used this site https://onlinepngtools.com/convert-png-to-base64 and selected line chunking to create multiple lines

Then I prefixed the code with the following.

data:image/png;base64,

and wrapped the lot in double quotes.

Edit 24th July, 2019:

Reid Havens also has a blog on this topic.  You an see that article here.

Where can I find a list of standard Power BI Icons?

Read my blog article here to find a list of Power BI Icon Names.

127 thoughts on “Conditional Formatting Using Icons In Power BI”

  1. At Karachi Call Girls Agency, we offer a premium selection of companions who embody sophistication, charm, and professionalism. Each profile reflects our commitment to providing an exceptional experience, whether for business dinners, social events, or a relaxed evening. Our Call Girls in Karachi are handpicked for their grace and warmth, ensuring clients enjoy not just beauty, but genuine, memorable company in Karachi.

  2. At Lahore call girls Agency, we specialize in providing premium companionship that blends elegance and warmth. Our companions are carefully selected for their sophistication, charm, and ability to make every moment enjoyable. Whether you need a graceful partner for a formal event or a friendly face for a relaxed evening, our agency ensures a seamless experience filled with class and comfort in Lahore.

  3. Hiya! I know this is kinda off topic nevertheless I’d figured I’d ask.
    Would you be interested in trading links or maybe guest
    writing a blog post or vice-versa? My site goes
    over a lot of the same subjects as yours and I feel we could greatly benefit from
    each other. If you might be interested feel free to send me an email.
    I look forward to hearing from you! Superb blog by the way!

    Also visit my web blog; just-kill

  4. Attractive portion of content. I simply stumbled upon your site
    and in accession capital to assert that I get actually loved account your blog posts.
    Anyway I will be subscribing on your augment and even I fulfillment you access consistently quickly.

    My blog: justkill

  5. في عالم الضيافة العربية، لا شيء يضاهي روعة تمر، تمور سعودية عالية الجودة، هدايا تمور فاخرة للعائلات، رز حساوي نخب أول، لومي حساوي طبيعي، تمور رمضان الفاخرة، متجر تمور أونلاين موثوق، تمور فاخرة للمناسبات. تُعد هذه المنتجات رمزاً للجودة والفخامة، حيث يتم اختيار أجود أنواع التمور والمنتجات الحساوية بعناية فائقة. من المعروف أن التمور ليست مجرد طعام، بل هي إرث ثقافي يعكس كرم الضيافة العربية وأصالة المذاق الفريد. كما أن الطلب المتزايد على هذه المنتجات جعلها خياراً مثالياً للمناسبات الخاصة والاحتفالات، لتكون دائماً حاضرة على الموائد. إن تمر رزيز نادر يعكس تميز الإنتاج المحلي وجودته. إن الحسا يعكس تميز الإنتاج المحلي وجودته.

  6. إذا كنت تبحث عن تجربة مميزة في دردشة فلسطينية مجانية توفر لك التواصل مع الأصدقاء والتعارف مع أشخاص جدد من مختلف أنحاء فلسطين، فإن منصتنا تقدم لك كل ما تحتاجه. يمكنك الآن الانضمام بسهولة إلى شات فلسطيني مجاني والاستمتاع بمحادثات آمنة وسريعة. استكشف الغرف المتنوعة وشارك في النقاشات الممتعة عبر شات بدون تسجيل. جرب الخدمة الآن من خلال هذا الرابط: https://play.google.com/store/apps/details?id=com.chat.chatpaestine&pli=1

  7. خلال تجربتي الأخيرة لاحظت أن خدمات في العمل لسنتين إضافيتين مهمة جداً للأسر، خاصة مع توفر خيارات مثل للتنازل الفلبين والتي تلبي احتياجات متنوعة. الكثير يهتم أيضاً بموضوع الصدعان يشير إلى وجود عاملات لأنه يوفر راحة وضمان. من المهم أن نجد للتنازل بنغلاديش مع استلام فوري في اليوم نفسه حيث يضمن جودة واستقرار الخدمة.

  8. Holiday 2025 looks promising for tourists seeking unique cultural experiences and safe travel opportunities. I also think world tourism plays a crucial role in a successful trip. If you’re looking to make the most of your travel budget, consider the benefits of leisure travel and using points from travel credit cards. I also think travel insurance plays a crucial role in a successful trip.

  9. May I just say what a comfort ultimateshop to find
    someone that truly understands what they’re talking about on the
    web. You certainly realize how to bring a problem to light and make it important.
    A lot more people should check this out and understand this
    side of the story. I was surprised you aren’t more popular
    because you most certainly have the gift.

  10. I like the helpful info you supply to your articles.
    I’ll bookmark your weblog and take a look at again here frequently.
    I’m fairly certain I will be informed many new stuff right here!
    Good luck for the next!

    my web page; bclub

  11. Hi there, just became aware of your blog through Google, and found that it’s truly informative.
    I’m gonna watch out for brussels. I will be grateful if you continue this in future.
    A lot of people will be benefited from your writing.
    Cheers!

    my homepage: bclub mom

  12. Simply want to say your article is as amazing. The clarity on your submit is
    just great and that i can suppose you’re an expert on this
    subject. Well together with your permission allow me to clutch your
    RSS feed to keep updated with forthcoming post. Thanks one million and
    please keep up the rewarding work.

    My web page bclub

  13. I’ve been browsing online more than three hours today, but I never
    found any interesting article like yours.
    It is lovely value sufficient for me. Personally,
    if all site owners and bloggers made good content as you probably did,
    the web will likely be a lot more helpful than ever before.

    Here is my web blog; savastan0

  14. We have one of the most popular Murree Call Girls. We provide a variety of gorgeous Call Girls in Murree who are always on call and available to meet you at your home or hotel room within 30 minutes. When you call our girls, we are ready to send you the best Call Girls service for your needs. All of our Girls make excellent companions for any event and will help you to enjoy your time in Murree to the fullest.

  15. We provide the best Escorts in Lahore, who are not only beautiful but also intelligent and charming. We know that our clients require the best, so we make sure that all of our Escorts girls in Lahore meet the highest standards. Whether you are looking for a date for a special occasion or just want some company for a night out, we have the perfect girl for you. Contact us now to book your appointment!

  16. I think everything published was actually very logical. However, what about this?
    suppose you were to write a killer title? I mean, I don’t wish to tell you how to
    run your blog, but suppose you added something that grabbed folk’s attention? I mean Conditional Formatting Using Icons In Power BI 🔶 –
    Excelerator BI is kinda vanilla. You might peek at Yahoo’s front page and see how they
    create article titles to get people to open the links.
    You might add a video or a pic or two to grab readers interested about what you’ve
    got to say. In my opinion, it might make your posts a little livelier.

    Feel free to surf to my homepage; savastan0. cc

  17. Can I simply just say what a relief to discover an individual who truly understands what they’re talking about online.

    You actually know how to bring an issue to light and make
    it important. More people ought to read this and understand this side of your
    story. It’s surprising you aren’t more popular given that you most certainly have the gift.

    Look into my webpage; savastan0

  18. Balanceo dinamico
    Sistemas de calibración: fundamental para el desempeño estable y productivo de las máquinas.

    En el ámbito de la avances contemporánea, donde la eficiencia y la estabilidad del sistema son de máxima relevancia, los dispositivos de equilibrado tienen un tarea vital. Estos dispositivos especializados están diseñados para ajustar y fijar elementos rotativas, ya sea en herramientas manufacturera, transportes de movilidad o incluso en equipos domésticos.

    Para los técnicos en conservación de sistemas y los ingenieros, utilizar con aparatos de equilibrado es esencial para garantizar el desempeño uniforme y seguro de cualquier mecanismo rotativo. Gracias a estas herramientas tecnológicas innovadoras, es posible reducir sustancialmente las movimientos, el estruendo y la carga sobre los cojinetes, mejorando la tiempo de servicio de componentes importantes.

    De igual manera importante es el función que desempeñan los equipos de calibración en la servicio al usuario. El soporte especializado y el conservación constante aplicando estos dispositivos posibilitan dar prestaciones de gran estándar, incrementando la bienestar de los consumidores.

    Para los titulares de proyectos, la aporte en equipos de ajuste y medidores puede ser clave para aumentar la rendimiento y rendimiento de sus sistemas. Esto es especialmente relevante para los dueños de negocios que administran modestas y intermedias negocios, donde cada punto importa.

    Asimismo, los aparatos de balanceo tienen una gran uso en el sector de la protección y el control de estándar. Posibilitan localizar posibles fallos, impidiendo reparaciones caras y problemas a los sistemas. Además, los resultados obtenidos de estos dispositivos pueden aplicarse para perfeccionar sistemas y incrementar la reconocimiento en motores de investigación.

    Las zonas de implementación de los dispositivos de ajuste cubren numerosas ramas, desde la fabricación de vehículos de dos ruedas hasta el supervisión ambiental. No afecta si se habla de extensas producciones de fábrica o modestos locales de uso personal, los sistemas de balanceo son fundamentales para asegurar un desempeño productivo y libre de interrupciones.

      1. Would it look something like this?

        Icons Measure = IF (Engagements[Margin in % Engagements=blank(), “CircleEmpty”, (SWITCH(TRUE(), Engagements[Margin in % Engagements] >= sum(‘FOP-Plan'[FOP Margin Plan]), “TriangleHigh” , Engagements[Margin in % Engagements] >= sum(‘FOP-Plan'[FOP Margin Plan]) * .97 , “TriangleMedium” , Engagements[Margin in % Engagements] < sum('FOP-Plan'[FOP Margin Plan]) * .97 , "TriangleLow")

  19. I’m still new at this and cannot understand the “calendar” part in Step 2. I have followed the steps here and am getting no disparity between sales variances from year to year. How did you get Calendar[Date] in step#2 after DATEADD?

    1. Thanks for reporting this – sorry, I didn’t test online. It seems some browsers cannot resolve the # symbol. You need to replace the # with %23. Eg

      polygon fill=’#84C28A’

      with this

      polygon fill=’%2384C28A’

      I have updated this in the sample file

      1. Even if we replace %23 also internet explorer 11 is not showing up the conditional formatting icon. But chrome is working fine, What changes do I need to do for this IE11 compatability issue. Any changes to SVG code.

        SVG Code: Having issue with internet explorer 11. Icon is not visible. Chrome is working fine.
        “icons”: {
        ,”RedRightArrow”: {“description”: “Red Arrow Right”, “url”: “data:image/svg+xml;utf8, “}

        1. Power BI Report server is not showing up below icon(red color middle direction) in Internet explorer11 but working fine chrome browser. What changes do I need to do to the SVG code to display red color icon in IE11(power bi report server).

          {
          “name”: “PowerBI.Tips & Havens Consulting Icon Set”,
          “icons”: {

          ,”RedRightArrow”: {“description”: “Red Arrow Right”, “url”: “data:image/svg+xml;utf8, “}

          }
          }

  20. Hi Matt,
    Thanks for the post. I actually downloaded the formula made a few changes in it for my purposes and it worked great. Question: In addition to “StarMediumLight” is there a way to get access to all the names of the Standard Icons.
    Thanks,
    Rob

  21. Hi Matt, awesome blog post – thanks a lot for the detailed instructions!! I’ve successfully incorporated the icons using both the measure approach and through my custom theme. It all works perfectly within the Power BI desktop; however, when I publish to web the icons do not display. I’ve tested this out using your theme as well, and the up and down arrows don’t display (however, the GIF does). Based on this, my guess would be that the SVG syntax is not yet compatible with the Power BI service (as the GIF just links to a URL). Just wondering if you’ve experienced the same issues, and if you have any work arounds? Any help would be appreciated! Cheers, Alice

    1. OK, I spoke to my colleagues and it seems that some browsers do not correctly interpret the # in the SVG code. Please replace the # symbol with %23 in the SVG code and try again.
      eg, replace this

      polygon fill=’#84C28A’

      with this

      polygon fill=’%2384C28A’

      I have updated the defaults.json doc

  22. Hi Matt,
    Under the default settings in your example, any % change less than 33% should show the red icon. The second line in the table visual (Bike Stands) has a % change of 9.2% and has a yellow icon. Based on the rules I believe it should be a red icon. I’m running into a similar issue with my data and I’m wondering if it is a bug or perhaps caused by my measure’s dax code?
    Thanks,
    Dane

    1. That’s not how it works. Under the default settings, the tool analyses the range of data points. When you look at my data, the smallest value is -26.1% and the largest value is 74.1%. This is the range. This range is then split into 3 sections. 0 to 33% of the range, 34 to 66% of the range, 67 to 100% of the range. In my example, the cut over point from the first sector to the second sector is 6.97, hence 9.4% is in the middle sector.

  23. Hi Matt,
    I’m trying to replicate a report I have in excel but in Power BI, setting conditional formatting using Icons.
    I can’t see the Icon options in my Power BI sessions….any ideas why this may be the case? Does this only work or calculated fields?
    Thanks
    Paul

Leave a Comment