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 / If Statement on formul...
Power Apps
Answered

If Statement on formula based on negative or positive date value

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

Here is an example - Lets say DaraCardValue1 is 10/2/2023  and Today is 09/11/2023. 

 

DataCardValue1.SelectedDate - Today  = 10

 

What if DataCardValue1 is 09/09/2023 

 

DataCardValue1.SelectedDate - Today  = -2 

 

How can I based an if statment based on - / + result?

 

ie: If  DataCardValue1.SelectedDate - Today  = Positive Value then  "10 days till conclusion"  Or 

If  DataCardValue1.SelectedDate - Today  = Negative then "2 days overdue"

 

Categories:
I have the same question (0)
  • Verified answer
    TuxedoMask Profile Picture
    21 on at

    Try This:

     

    If (DataCardValue1.SelectedDate - Today  > 0,  DataCardValue1.SelectedDate - Today() &" days till conclusion",DataCardValue1.SelectedDate - Today() & " days overdue");

     

     

  • SpongYe Profile Picture
    5,715 Super User 2026 Season 1 on at

    Hi @wonka1234 

     

    The DateDiff function returns the difference between two date/time values. The result is a whole number of units.

     

    If(
     DateDiff(Today(), DateValue(DataCardValue1.SelectedDate)) > 0,
     DateDiff(Today(), DateValue(DataCardValue1.SelectedDate)) & " days till conclusion",
     DateDiff(Today(), DateValue(DataCardValue1.SelectedDate)) < 0,
     DateDiff(Today(), DateValue(DataCardValue1.SelectedDate)) & " days overdue"
    )

     

     


    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard