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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
AllanBerces
Post Prodigy
Post Prodigy

Visual calculation- Contain

Hi good day can anyone help me on my visual calculation. May colunm status contain 'OVERDUE". What i required is to turn red the word "OVERDUE"

AllanBerces_0-1780904148326.png

AllanBerces_1-1780904180846.png

Thank you

1 ACCEPTED SOLUTION
rampie
Advocate V
Advocate V

In Power BI you can't directly set a colour on a text value. The way to do it is to base your formatting on a seperate field or measure that returns the colour you want, as described in the docs【920987970406761†L715-L735】.

Here's one way to do it: create a measure that returns a hex code when the status contains "OVERDUE" and something else otherwise, e.g.:

StatusColor =
IF (
CONTAINSSTRING ( SELECTEDVALUE ( 'YourTable'[Status] ), "OVERDUE" ),
"#C00000", // red
"#000000" // black
)

Add your status field to the visual, then go to the value dropdown → Conditional formatting → Font color. Choose **Field value** and point it at the StatusColor measure. The word OVERDUE will appear in red and the rest will stay black. You can extend thsi to handle other statuses too.

View solution in original post

5 REPLIES 5
V-yubandi-msft
Community Support
Community Support

Hi @AllanBerces ,

Could you please confirm if your issue has been resolved, or if you still need any additional details or clarification from our side.

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @AllanBerces ,

If you get a chance, please review the responses shared by @rampie , @Kedar_Pande . They have correctly pointed out the key points, so kindly check and let us know if you need any additional details.

 

Thank you all for your valuable support @Kedar_Pande @rampie @krishnakanth240 .

 

Regards,

Yugandhar.

Kedar_Pande
Super User
Super User

@rampie 

 

Add a calculated column or measure that flags the OVERDUE rows, then use conditional formatting on the field's font color.

Color = IF(CONTAINSSTRING(SELECTEDVALUE('Table'[LookaheadStatus]), "OVERDUE"), "#FF0000", "#000000")

That turns the OVERDUE text red and leaves everything else black.

krishnakanth240
Super User
Super User

Hi @AllanBerces 

Color =

IF(

CONTAINSSTRING([Status], "OVERDUE"),

"#FF0000",

"#000000")

Conditional Formatting - Font Color - Format by Field Value and select field

rampie
Advocate V
Advocate V

In Power BI you can't directly set a colour on a text value. The way to do it is to base your formatting on a seperate field or measure that returns the colour you want, as described in the docs【920987970406761†L715-L735】.

Here's one way to do it: create a measure that returns a hex code when the status contains "OVERDUE" and something else otherwise, e.g.:

StatusColor =
IF (
CONTAINSSTRING ( SELECTEDVALUE ( 'YourTable'[Status] ), "OVERDUE" ),
"#C00000", // red
"#000000" // black
)

Add your status field to the visual, then go to the value dropdown → Conditional formatting → Font color. Choose **Field value** and point it at the StatusColor measure. The word OVERDUE will appear in red and the rest will stay black. You can extend thsi to handle other statuses too.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.