cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chicko29
Level: Powered On

Greater than or equal operator for date difference in gallery

The greater than or equal operator for a date difference in gallery is not working

 

I have a custom gallery with a Label field named Days.

I put the following for the Text property which works : DateDiff(ThisItem.Date,Now()) 

I put the following for the color property which doesn't work: If(Days.value >= 5, Red, Green). I also tried If(Days.text >= "5", Red, Green)

 

What am I doing wrong? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Greater than or equal operator for date difference in gallery

Hi @Chicko29

Because Days is a unit type that's associated with the DateAdd function, I would name your label LabelDays rather than Days.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

Once you do this, the following syntax should work:

If(Value(LabelDays.Text) >= "5", Red, Green)

 

View solution in original post

1 REPLY 1
Super User
Super User

Re: Greater than or equal operator for date difference in gallery

Hi @Chicko29

Because Days is a unit type that's associated with the DateAdd function, I would name your label LabelDays rather than Days.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

Once you do this, the following syntax should work:

If(Value(LabelDays.Text) >= "5", Red, Green)

 

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,779)