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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ld17
Helper II
Helper II

Using conditional formatting icons for text

I would like to set up conditional formatting on my matrix so that a yellow, red, or green icon shows up in the cell depending on whether the user has completed it or not. If the user has completd it, a date will display (would like a green icon to show up next to the date). If the user has not completed it, the cell will either have "not assigned," "in progress," "or registered" in it (would like a yellow or red icon here). The issue is that the default options for conditional formatting only allow me to input percentage, and there are no percentages in my data, just a date or "in progress," "registered," etc. I cannot find an option to change this so that I can input text for conditional formatting. A screenshots is below:

 

ld17_0-1675285514587.png

 

1 ACCEPTED SOLUTION

Hi, @ld17 

You can try to use this dax code:

Measure 2 = var _flag= MAX('Table'[Column1])
return
SWITCH( TRUE() , 
_flag="deleted" , 1,
_flag="in progress" , 2,
_flag="registered",3,
IFERROR(DATEVALUE(_flag),-1)<>-1,4
)

The configuration need to add '4':

vyueyunzhmsft_0-1675386632239.png

The result is as follows:

vyueyunzhmsft_1-1675386646343.png

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
ld17
Helper II
Helper II

Thanks so much for the solution. This works well. One question: if a completed training displays as a date rather than the text "completed," what value should I be putting below?

 

ld17_0-1675348458805.png

ld17_1-1675348499960.png

 

Hi, @ld17 

You can try to use this dax code:

Measure 2 = var _flag= MAX('Table'[Column1])
return
SWITCH( TRUE() , 
_flag="deleted" , 1,
_flag="in progress" , 2,
_flag="registered",3,
IFERROR(DATEVALUE(_flag),-1)<>-1,4
)

The configuration need to add '4':

vyueyunzhmsft_0-1675386632239.png

The result is as follows:

vyueyunzhmsft_1-1675386646343.png

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

This works perfect. Thanks so much!

v-yueyunzh-msft
Community Support
Community Support

Hi , @ld17 

According to your description, you want to add a conditional formatting icons for a text .

Here are the steps you can refer to :
[1] First method , we can add a measure to just return the image, like this:

Measure = var _flag= MAX('Table'[Column1])
return
SWITCH( _flag , 
"deleted" , "🔴",
"in progress" , "🟢",
"registered","🟡")

Then we just need to put the measure on the visual and we can meet your need:

vyueyunzhmsft_0-1675302980454.png

 

[2]Second , we can also add a measure as the judgement to the "conditional formatting icons".

Measure 2 = var _flag= MAX('Table'[Column1])
return
SWITCH( _flag , 
"deleted" , 1,
"in progress" , 2,
"registered",3)

Then we configure the "conditional formatting icons":

vyueyunzhmsft_1-1675303046740.png

We can also meet your need , the result is as follows:

vyueyunzhmsft_2-1675303066965.png

 

[3]The third method can add some custom icon in power bi , if you need , you can refer to :
Include Custom Icons in Your Tables - Microsoft Power BI Community

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.