web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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,616 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard