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 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,535 Super User 2025 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,535 Super User 2025 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

Forum hierarchy changes are complete!

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

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 445

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 321 Super User 2025 Season 2

Last 30 days Overall leaderboard