Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Antonio74
Regular Visitor

Order data

Hello, I have this situation. My point control clock gives me 1 line for each movement. As you can see in the file in green, the operator 1552 it's in at 08:06:00 and gets out at 16:09:00.  In this case he works 08:03:00   
how can I get thease values in the same line ( time in and time out ) in Power query ?

CCCED301-BBFD-43EF-8593-9E63D6333939.jpeg

3 REPLIES 3
wdx223_Daniel
Community Champion
Community Champion

if all the ENTRADA and SAIDA come in pairs in the column of DIRECTION, then try this code:

NewStep=let a={"ENTRADA","SAIDA"} in Table.Combine(Table.Group(PreviousStepName,{"COLABORADOR","DATA REGISTO"},{"n",each #table({"COLABORADOR","Date","TotalTime"}&List.TransformMany({1..Table.RowCount(_)/2},each a,(x,y)=>Text.From(x)&"# "&y),{{[COLABORADOR]{0},[DATA REGISTO]{0},List.Sum(List.Transform(List.Split([HORA PICAGEM],2),each _{1}-_{0}))}&[HORA PICAGEM]})})[n])

 

 Good morning, first of all thanks for the help. when applying this step I get the error "Expression.Error: The number is out of range of a 32-bit integer value.
Details: 0.5"
I suppose it's because someone forgot some record

you may get a odd number of rows

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors