Forum Discussion
Calculate Time
- 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
hi, RussHaight
try below measure. It might help
- RussHaight2 years agoNew Member
Thank you for your reply. Copying and pasting what you wrote throws a lot of red so I changed it to what i think you are explaining to me but I get the following error.
Also, is this formula supposed to be a measure or an added column on the punch table?
- Dangar3322 years agoResident Rockstar
hi, RussHaight
it's a measure.and remove )) from code it give you answer
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)returncin above code red part is table name i use as 'time' so replace your table name with 'time'- RussHaight2 years agoNew Member
the red ) is added automatically when I click out of the code window and if I hit enter again while in the code window, it adds another one, and so on.
so after Return
c
I click out and it adds one ), I click in and then out, it adds another one ))
- Dangar3322 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