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 / Greater than or equal ...
Power Apps
Answered

Greater than or equal operator for date difference in gallery

(0) ShareShare
ReportReport
Posted on by 38

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? 

 

Categories:
  • Verified answer
    timl Profile Picture
    37,324 Super User 2026 Season 2 on at

    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)

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard