Forum Discussion
JARONN
6 years agoFrequent Visitor
Problem with hour calculation
Person id Index 1 Code Work Order Index 2 date/time in/out calculation 1 50 in 102 ...
- 6 years ago
Hi JARONN
If i understand you correctly,
first add a index column in Edit queries,
then create calculated columns in Data model view,
out = CALCULATE ( LASTNONBLANK ( Sheet1[Code], 0 ), FILTER ( ALLEXCEPT ( Sheet1, Sheet1[person id ] ), Sheet1[Index 1] = EARLIER ( Sheet1[Index 1] ) + 1 && Sheet1[Index] > EARLIER ( Sheet1[Index] ) ) ) condition = IF([out]="out","in",IF([out]="<>out","out")) in/out cal = CALCULATE ( LASTNONBLANK ( Sheet1[condition], 0 ), FILTER ( ALLEXCEPT ( Sheet1, Sheet1[person id ] ), Sheet1[Index] <= EARLIER ( Sheet1[Index] ) ) )Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
6 years agoCommunity Support
Hi JARONN
If i understand you correctly,
first add a index column in Edit queries,
then create calculated columns in Data model view,
out =
CALCULATE (
LASTNONBLANK ( Sheet1[Code], 0 ),
FILTER (
ALLEXCEPT ( Sheet1, Sheet1[person id ] ),
Sheet1[Index 1]
= EARLIER ( Sheet1[Index 1] ) + 1
&& Sheet1[Index] > EARLIER ( Sheet1[Index] )
)
)
condition = IF([out]="out","in",IF([out]="<>out","out"))
in/out cal =
CALCULATE (
LASTNONBLANK ( Sheet1[condition], 0 ),
FILTER (
ALLEXCEPT ( Sheet1, Sheet1[person id ] ),
Sheet1[Index] <= EARLIER ( Sheet1[Index] )
)
)
Best Regards
Maggie
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- JARONN6 years agoFrequent Visitor
Thanks!
With minor changes i got it.