Forum Discussion

AzJackson's avatar
AzJackson
New Member
3 years ago
Solved

Caluate days between days witha including a today variable

Hello,

 

Need help with a formula for a measure please.

My data has two date columns, Start Date, Closed Date.

The start date allways has a date in it

The closed date will not have a date in it untill the data sourse is updated with a closed date.

 

So if there is no closed data what I would like for the measure to do is calucate the number of days between Start and Today for each row of data once there is a date entered in the field I would like to caluate the number of days between Start and Closed.

 

Baiscally trying to create a visual that shows number of records that have or are still exceeding a 28 day target 

 

Thanks for any help

  • AzJackson add a new column using the following logic

     

    Number of Days = DATEDIFF ( Table[Start Date], COALEASCE ( Table[End Date], TODAY () ), DAY )

     

    Follow us on LinkedIn and  to our YouTube channel

    I would ❤ Kudos if my solution helped. If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

  • Anonymous's avatar
    Anonymous
    3 years ago

    DATEDIFF([Start Date],IF(ISBLANK(Closed Date) = TRUE(),NOW(),[Closed Date]),DAY)

     

    Try this.

     

    It's saying "Get the date difference in days between start date and closed date, if the closed date is blank, use today's date".

    Let me know if this works. Kind regards.

4 Replies

  • AzJackson add a new column using the following logic

     

    Number of Days = DATEDIFF ( Table[Start Date], COALEASCE ( Table[End Date], TODAY () ), DAY )

     

    Follow us on LinkedIn and  to our YouTube channel

    I would ❤ Kudos if my solution helped. If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

  • Anonymous's avatar
    Anonymous
    Not applicable

    DATEDIFF([Start Date],IF(ISBLANK(Closed Date) = TRUE(),NOW(),[Closed Date]),DAY)

     

    Try this.

     

    It's saying "Get the date difference in days between start date and closed date, if the closed date is blank, use today's date".

    Let me know if this works. Kind regards.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Create a calculated column using this, not a measure by the way. Good luck!