4 Replies Latest reply on Jan 2, 2018 9:49 AM by David Bull

    Calculating Time Between Two Dates in The New Year

    Aaron Rodriguez

      Hello all,

       

      I have a dashboard that shows the average time to finish a project. I have been using the following calculation to get this number:

       

      DATEDIFF('weekday', [Ticket Received], [Ticket Completed]) -2 *

      (DATEPART('week', [Ticket Completed]) -

      DATEPART('week', [Ticket Received])) +

      (IF DATENAME('weekday', [Ticket Completed]) = 'Saturday'

      OR DATENAME('weekday', [Ticket Received]) = 'Sunday'

      THEN 0

      ELSE 1

      END)

       

      The calculation calculates the time between the opening date and closing date taking only the work week into account (Saturdays and Sundays count as 0's in this calculation). When I opened the dashboard in the new year, the numbers were completely off for my projects that are still open or ended after 1/1/2018. Some times are in the 100's of days now even though they were opened in the week after Christmas.

       

      Any help that could be provided would be greatly appreciated.