Forum Discussion
Vatz8
Helper I
3 years agoSUMX Calculation
Hi, I am trying to add consecutive punch hours in consecutive hours column if the difference between the current row and the previous row is less than 1.5. I have already added an index column ...
v-chenwuz-msft
Community Support
3 years agoHi Vatz8 ,
A simple workaround, change the earlier(vm_moc[employee]) to max(vm_moc[employee]).
Try this code:
Consecutive hours =
SUMX (
FILTER (
ALLSELECTED ((vw_moc),
vw_moc[employee] = max ( vw_moc[employee] )
&& (
LOOKUPVALUE ( vw_moc[TimeDifference], vw_moc[Index], vw_moc[Index] )
- LOOKUPVALUE ( vw_moc[TimeDifference], vw_moc[Index], vw_moc[Index] - 1 )
) < 1.5
&& vw_moc[Index]
> LOOKUPVALUE ( vm_moc[TimeDifference], vw_moc[Index], vw_moc[Index] - 1 )
),
vw_moc[punch_hours]
)
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Vatz83 years ago
Helper I
This formula is returning with an error, probably due to the allselected()