web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to change the font...
Power Apps
Unanswered

How to change the font color if the date is near to expiry or expired

(0) ShareShare
ReportReport
Posted on by 2

I have a gallery, having the date field "RenewalDate". currently all the field color is blank.

On gallery view, I want to change the font based on the below:

 

If Current Date - RenewalDate is Less than or  15  days left then blue color font (meaning it will remind me that it is approaching to expire)

If RenewalDate = CurrentDate or greater than current date then red color font ( which will mean that either the expiry is today or already expired)

 

Please advise how to write the code and where to apply, so that the gallery can have the wanted view.

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @MIA27 ,

    Assuming your default colour is Black - on the Color of the control

    With(
     {
     wRemind:
     DateAdd(
     Today(
     15,
     Days
     )
     },
     If(
     ThisItem.RenewalDate <= Today(),
     Red, 
     ThisItem.RenewalDate <= wRemind,
     Blue,
     Black
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard