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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
fbittencourt
Advocate II
Advocate II

Add an icon on a mesure created

Hi all ! 

 

I would like a simple thing add an icon to my mesure [PctKPI 2]

 

Format cond PCTKPI icones =  
SWITCH(
    TRUE(),
ABS([PctKPI 2]) >=0 && ABS([PctKPI 2])<= 0.0549, "🟢" ,
ABS([PctKPI 2]) >=0.055 && ABS([PctKPI 2])<= 0.1049 , "🟡",
ABS([PctKPI 2]) >=0.105 && ABS([PctKPI 2])<= 1 , "🔴",
 "   ")
 
Now I have just the icon on the card I need both together  

 

 
fbittencourt_1-1744710868466.pngfbittencourt_2-1744710947317.png

 tks in advance!!

 

1 ACCEPTED SOLUTION
grazitti_sapna
Super User
Super User

Hi @fbittencourt , 
Please use below DAX:

Format cond PCTKPI with icon :=
VAR Pct = [PctKPI 2]
VAR Icon =
SWITCH (
TRUE (),
ABS(Pct) >= 0 && ABS(Pct) <= 0.0549, "🟢",
ABS(Pct) >= 0.055 && ABS(Pct) <= 0.1049, "🟡",
ABS(Pct) >= 0.105 && ABS(Pct) <= 1, "🔴",
""
)
RETURN
FORMAT(Pct, "0.00%") & " " & Icon

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

🔗 Curious to explore more? [Discover here].

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @fbittencourt 

Conditionally formatting a card using icons is currently not supported. You can apply conditional formatting to the background, value, label, and border, but not display icons as part of the card's conditional formatting.

As a workaround, you can return a value combined with an icon as a text string, but the icon and value cannot be formatted separately.

Alternatively, consider using the new tile slicer visual. It allows you to add a label and an image (which can be a DAX-generated SVG), which can be styled to closely resemble a traditional card while enabling more flexible visual formatting.

danextian_0-1744714172335.gif

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
grazitti_sapna
Super User
Super User

Hi @fbittencourt , 
Please use below DAX:

Format cond PCTKPI with icon :=
VAR Pct = [PctKPI 2]
VAR Icon =
SWITCH (
TRUE (),
ABS(Pct) >= 0 && ABS(Pct) <= 0.0549, "🟢",
ABS(Pct) >= 0.055 && ABS(Pct) <= 0.1049, "🟡",
ABS(Pct) >= 0.105 && ABS(Pct) <= 1, "🔴",
""
)
RETURN
FORMAT(Pct, "0.00%") & " " & Icon

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

🔗 Curious to explore more? [Discover here].

pankajnamekar25
Super User
Super User

Hello @fbittencourt 

 

Modify measure as below

PCTKPI Icon + Value =

VAR KPI = [PctKPI 2]

VAR Icon =

    SWITCH(

        TRUE(),

        ABS(KPI) >= 0 && ABS(KPI) <= 0.0549, "🟢",

        ABS(KPI) >= 0.055 && ABS(KPI) <= 0.1049, "🟡",

        ABS(KPI) >= 0.105 && ABS(KPI) <= 1, "🔴",

        ""

    )

RETURN

Icon & " " & FORMAT(KPI, "0.00%")

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors