Forum Discussion

KellerB's avatar
KellerB
Frequent Visitor
3 years ago
Solved

Calculating hours worked over x days excluding down time

Hi! I have a problem that I have been trying to solve for days. I need to calculate working hours by manufacturing line over multiple days. the problem is I have to do this by time of first unit produced-time of last unit produced for each day. I dont know how to go through each day, take the min time and max time, subtract the two, and add to a running total going through everyday that my date slicer has included. If you are able to help that would be awesome!! Let me know

 

Here is some sample data. This will eventually allow me to calculate an accurate "Units per hour".

so for line 1 it should return (8am-4pm) + (7am-1pm) +(6am-2pm) = 22 hours worked 

I will have a table that has line number as the first column and working hours (this output) as the second column and sliced using a calender...

Line NumberDateTimeUnits
19/20/20228am1
19/20/202210am1
19/20/20221pm1
19/20/20224pm1
19/21/20227am1
19/21/20229am1
19/21/202211am1
19/21/20221pm1
19/22/20226am1
19/22/202210am1
19/22/20222pm1
29/20/20228am1
29/20/202210am1
29/20/20221pm1
29/20/20224pm1
29/21/20227am1
29/21/20229am1
29/21/202211am1
29/21/20221pm1
29/22/20226am1
39/21/202210am1
39/21/20222pm1
39/22/20229am1
39/22/202211am1
39/22/20221pm1

9 Replies

  • davehus's avatar
    davehus
    Icon for Memorable Member rankMemorable Member

    Hi KellerB ,

     

    I've attached a solution using a summarized table. Let me know if this meets your needs.

     

    Did I help you today? Please accept my solution and hit the Kudos button.

    • KellerB's avatar
      KellerB
      Frequent Visitor

      I just realized my date column contains the day and time so the table creates a new row for everytime. how do i create a new column for just the date? I would like to avoid changing my existing date column as i have measures using it.

      • davehus's avatar
        davehus
        Icon for Memorable Member rankMemorable Member

        Hi KellerB, Try wrapping the datetime in Date() in the summarize table.