Forum Discussion
RussHaight
2 years agoNew Member
Calculate Time
Hello, I'm trying to figure out a way to calculate time diff. In the table the time in and time out are in the same field with a punch type determining if it was in or out Table structure is lik...
- 2 years ago
sorry-had an extra ], I removed it now I don't get the red )
Thank you-I'm going to see if I can leverage a measure as to what I am trying to do-which is calculate hours workd by employee_number on any given day/week/month/etc
Dangar332
2 years agoResident Rockstar
hi, RussHaight
try below measure. It might help
timediff =
var g =MIN('time'[punch date/time])
var a = CALCULATE(MAX('time'[punch date/time]),'time'[punch type]="id")
var b = CALCULATE(MAX('time'[punch date/time]),'time'[punch type]="od")
var c =CALCULATE(DATEDIFF(a,b,HOUR),'time'[punch date/time]=g)
return
c
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Dangar332
2 years agoResident Rockstar
Hi, RussHaight
If above post helps, then please consider Accepting it as the solution to help the other members find it more quickly