Forum Discussion

stefani_vileva's avatar
stefani_vileva
Resolver II
4 years ago
Solved

Calculating breaks in working time

Hello everyone,   I have problem solving the time duration between times of two different rows. For example, I have the following table:   Date Name Department Coming Going 13.06.2022 ...
  • FarhanAhmed's avatar
    4 years ago

    you can create a calculated column to get the Last out for particular day and then take the difference between 2 times

     

    Last Out = 
    Var dt = 'Table'[Date]
    Var nm = 'Table'[Name]
    Var dpt = 'Table'[Department]
    var cmg = 'Table'[Coming]
    RETURN 
    
    CALCULATE(MAX('Table'[Going]),FILTER('Table','Table'[Date]=dt && 'Table'[Name]=nm && 'Table'[Department]=dpt && 'Table'[Coming]<cmg ))