cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,705)