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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Super User
Super User

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors