Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to calculate overtime

Good morning people !

 

I have a spreadsheet with days and hours worked, it has the same day in different lines, and I need to calculate the hours exceeding 8 hours.

 

How can I do this ?

 

User NameDateInterval StartInterval EndTotal Hours Worked
anonymous12/04/202207:28:0912:01:0004:32:51
anonymous12/04/202213:00:2616:31:0803:30:42
anonymous13/04/202207:51:3312:01:0004:09:27
anonymous13/04/202212:53:5414:19:2301:25:29
anonymous13/04/202214:19:2916:59:2602:39:57

 

Can anybody help me.

 

Thanks

  • Hi,

    I am not sure if I understood correctly your question, but please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

    Hours exceeding 8 hours CC = 
    VAR currentend = Data[Interval End]
    VAR currentdate = Data[Date]
    VAR workinghours =
        FORMAT (
            SUMX (
                FILTER ( Data, Data[Interval End] <= currentend && Data[Date] = currentdate ),
                Data[Interval End] - Data[Interval Start]
            ),
            "hh:mm:ss"
        )
    RETURN
        IF (
            workinghours <= "08:00:00",
            BLANK (),
            FORMAT ( workinghours - 1 / 3, "hh:mm:ss" )
        )
    
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Jihwan_Kim,

    Thanks for the help, that's exactly what I needed.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Jihwan_Kim,

    Thanks for the help, that's exactly what I needed.

  • Hi,

    I am not sure if I understood correctly your question, but please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

    Hours exceeding 8 hours CC = 
    VAR currentend = Data[Interval End]
    VAR currentdate = Data[Date]
    VAR workinghours =
        FORMAT (
            SUMX (
                FILTER ( Data, Data[Interval End] <= currentend && Data[Date] = currentdate ),
                Data[Interval End] - Data[Interval Start]
            ),
            "hh:mm:ss"
        )
    RETURN
        IF (
            workinghours <= "08:00:00",
            BLANK (),
            FORMAT ( workinghours - 1 / 3, "hh:mm:ss" )
        )