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.
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):
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.
Please advise
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
)
)
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional