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:
I have the same question (0)
  • BCBuizer Profile Picture
    22,577 Super User 2026 Season 1 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,577 Super User 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard