Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Date Difference with a switch between two dates and One date and Today

I have two dates on my table. These two dates represent the start date and the End date of projects. I have a measure called Days elapsed that looks at the number of days that have passed. It is as b...
  • goncalogeraldes's avatar
    goncalogeraldes
    5 years ago

    Hey thereAnonymous, how about this one? If this one does not work try with a SWITCH() instead of an IF()!

     

    IF( _status in {"completed", "removed"}, DATEDIFF ( _start_date, _end_date, DAY ), 0 )

     

    Hope this answer solves your problem! If you need any additional help please tag me in your reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
    Thanks!

    Best regards,
    Gonçalo Geraldes