cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Williamspsouza Helper II
Helper II

Sum time from Time card

Hi Folks,

I`m trying to get all  employee worked time.

E.g.

In this table we have Sarah, John, Lucca and Peter.

IndexNameDay DD-MM-YYYYCheck
1Sarah01/02/202008:01:00
1Sarah01/02/202011:49:00
1Sarah01/02/202013:05:00
1Sarah01/02/202017:25:00
3John01/02/202008:01:00
3John01/02/202011:49:00
3John01/02/202013:05:00
3John01/02/202017:25:00
3John01/02/202018:30:00
3John01/02/202019:25:00
4Lucca01/02/202008:05:00
5Peter01/02/202008:10:00
5Peter01/02/202012:10:00
5Peter01/02/202013:09:00

 

Times:

Sarah: 

08:08:00

John: 

09:03:00

Lucca:

-08:00:00

Peter:

-04:05:00

 

 

 

Table :

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hdAxCoAwDAXQu3QWTNKKmiOIg+AoDkUEJwXR+xsp6mKbKXx4hJ8Mg0GTmd7vfpEJmAPlBAR3qBjQjFmCILKrFWIZCoWUTIFYSc22rPEqMfE1iYq3SFSoPbBiC2lRPzucpPacJv93TCCFpG4+5v2HIKQJkk7kYvnJeAE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Index = _t, Name = _t, #"Day DD-MM-YYYY" = _t, Check = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Day DD-MM-YYYY", type date}, {"Check", type time}, {"Index", Int64.Type}})
in
    #"Changed Type"

 

 Tks for your help...

3 REPLIES 3
Microsoft v-easonf-msft
Microsoft

Re: Sum time from Time card

Hi , @Williamspsouza 

Can you talk about how to calculate the working hours of workers?

I don't  quiet understand Lucca and peter's worked time.

72.png

Best Regards,
Eason

Williamspsouza Helper II
Helper II

Re: Sum time from Time card

Hi @v-easonf-msft.

It's because the schedule is 8 hours/day and 1 hours to lunch, so I wait for this hours.

Microsoft v-easonf-msft
Microsoft

Re: Sum time from Time card

Hi , @Williamspsouza 

Sorry for the later reply .

 

It's still  difficult to understand   how to calculate the working hours .

The most confusing thing is that the number of records for each person is completely different.

Without a specific calculation rule, it would be difficult for me to write dax...

Sarah : 
(11:49- 08:01)+(17:25 - 13:05)                    3:48+4:20=08:08    
the same to the result your gave  "08:08"

John:
(11:49:-08:01)+(17:25-13:05)+(19:25-18:30)        3:48+4:20+0:45=8:03    
How  to get  the result "09:03" ?

Lucca:  One record   "08:00"     
How  to get  the result "-08:00"?

Peter:   Three record
How  to calculate  the result "-04:05"?

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors