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
Anonymous
Not applicable

Total Break Time for Employees

Hi Team,

I have a dataset containing the biometric time of each employees:

amitkumar93_0-1661508662938.png


I need to calculate the total break time for each employees. There are multiple entry and exit time for each employee for a day.
Break time should be calculated as : (each Log out time - Immediate next log in time),

Please help.

Thanks
Amit

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try this column:

Break time = 
var _f = TOPN(1,FILTER('Table',[Date & Time]>EARLIER('Table'[Date & Time])&&[User ID]=EARLIER('Table'[User ID])),[Date & Time],ASC)
VAR _S = MAXX(_f,[Date & Time])
VAR _D = IF(ISBLANK(_S),0,DATEDIFF([Date & Time],_S,MINUTE))
RETURN
IF([Event Type]="LOGIN",0,_D)

 

Result:

vchenwuzmsft_0-1661940837466.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try this column:

Break time = 
var _f = TOPN(1,FILTER('Table',[Date & Time]>EARLIER('Table'[Date & Time])&&[User ID]=EARLIER('Table'[User ID])),[Date & Time],ASC)
VAR _S = MAXX(_f,[Date & Time])
VAR _D = IF(ISBLANK(_S),0,DATEDIFF([Date & Time],_S,MINUTE))
RETURN
IF([Event Type]="LOGIN",0,_D)

 

Result:

vchenwuzmsft_0-1661940837466.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks a lot, It works 🙂

Shreeram04
Resolver III
Resolver III

Hi @Anonymous 

 

Please find the below link for your reference.

 

https://youtu.be/KTgrgdvqO4Y

 

Thanks,

Anonymous
Not applicable

Hi Ram,

My dataset is different than the dataset mentioned in the vedio.

I dont have log in and log out time in the same row.

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.