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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to apply color to ...
Power Apps
Answered

How to apply color to the date field according to the criteria

(0) ShareShare
ReportReport
Posted on by 2

My data source is coming from sharepoint list. Which has field called "RenewalDate".

I see the data in the gallery view.

 

I want to apply color for the following criteria :

If RenewalDate is equal to today date OR less than than today date then apply red color font (this will indicate user that its already expired)

 

If RenewalDate is greater than today and within the date range of Today+15 days then Blue color font (this will indicate  user to prepare as its approaching to expire date)

 

If this above criteria not there, then let the font color to be blank as normal.

 

Please guide how to apply this on the gallery data.

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @MIA27 ,

     

    In your gallery, select the labels you wish to use this conditional formatting and set the Color property to:

    With(
     {
     _Renewal: DateDiff(
     Now(),
     ThisItem.Created
     )
     },
     If(
     _Renewal < 0,
     Red,
     _Renewal < 16,
     Blue,
     Black
     )
    )

     

  • MIA27 Profile Picture
    2 on at

    I tried your advised code, as below

    In gallery selected the label, and in its color property paste the your advised code, the result is all red, You can note in the data that test records are of 2016 and some of 28/7/2022.

     

    MIA27_0-1658945295715.png

     

     

     

    Please advise 

  • Verified answer
    BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @MIA27 ,

     

    Apologies, left the wrong column name in the formula while I was testing. Please use: 

    With(
     {
     _Renewal: DateDiff(
     Now(),
     ThisItem.RenewalDate
     )
     },
     If(
     _Renewal < 0,
     Red,
     _Renewal < 16,
     Blue,
     Black
     )
    )

     

    This is how it looks in my test (current date 28/07/2022):

    BCBuizer_0-1658998429878.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard