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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
alevandenes
Helper IV
Helper IV

calculate duration

Hi community,

 

i would like to calculate the duration of each clock in-clock out, considering that:

- Start and Stop rows will not follow each other most of the time

- there might be more clock ins per day for the same team member

 

alevandenes_0-1697527967084.png

Can someone help me?

Kind regards,
Alessandra

1 ACCEPTED SOLUTION

Hi @alevandenes ,

 

Assuming the id column corresponds to the order of timestamps, you first need to calculate the start of each stop time where teamMember is equal to the current row teamMember and [id] is < the current row [id] and deduct that from stop. You can then sum the result of a calculated column and show it in a visual. 

danextian_0-1697530546831.png

 

Pleasae see attached pbix for details.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
alevandenes
Helper IV
Helper IV

duration for example between 4 and 5, 6 and 7. but also 10 and 12

danextian
Super User
Super User

Hi @alevandenes ,

 

Can you please post your sample data as a text that anyone can copy paste as a table in Exel and not an image? Also to confirm, the duration is ids 5-4, 6-5 etc ?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

identryTypetimeStampteamMember
4Start2023-10-16 13:19:45.62812382
5Stop2023-10-16 13:21:10.79312382
6Start2023-10-16 13:21:40.15712382
7Stop2023-10-16 13:21:44.8812382
8Start2023-10-16 13:22:28.31316230
9Stop2023-10-16 13:23:24.24216230
10Start2023-10-16 13:24:27.73912073
11Start2023-10-16 13:26:05.89316230
12Stop2023-10-16 13:26:23.47312073
13Start2023-10-16 13:28:49.52212382
14Stop2023-10-16 13:29:36.05312382
15Start2023-10-16 13:29:48.39212382
16Start2023-10-16 13:30:00.59612382
17Stop2023-10-16 13:30:12.30912382
18Start2023-10-16 13:30:16.38412382
19Stop2023-10-16 13:30:57.83712382
20Start2023-10-16 13:31:17.91412382

Hi @alevandenes ,

 

Assuming the id column corresponds to the order of timestamps, you first need to calculate the start of each stop time where teamMember is equal to the current row teamMember and [id] is < the current row [id] and deduct that from stop. You can then sum the result of a calculated column and show it in a visual. 

danextian_0-1697530546831.png

 

Pleasae see attached pbix for details.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

amazing! thanks a lot!

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.