Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Days Remaining Calculation

I am looking for some help calculating days remaining.     That is to say that I have a specific field which identifies an "end date", and I am looking to calculate how many days between today and ...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Awesome.  Actually needed a MIN not MAX, as I was trying to get a day count between today and end date.  If end date is after today then 0.

     

    = MIN ( 1 * ( Today ( ) - YourTable[EndDate] ) , 0)

     

    Thanks - this was extremely helpful!

  • Datatouille's avatar
    Datatouille
    9 years ago

    Anonymous

     

    If [End Date] > Today ( ) Then 0 Else 1 * ( Today ( ) - YourTable[EndDate] ) is equivalent to

     

    MAX ( 1 * ( Today ( ) - YourTable[EndDate] ) , 0)

     or

    - MIN ( 1 * (  YourTable[EndDate] - Today ( )  ) , 0 )

     

    But not to:

    MIN ( 1 * ( Today ( ) - YourTable[EndDate] ) , 0)