Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Team,
I have a dataset containing the biometric time of each employees:
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
Solved! Go to Solution.
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:
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.
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:
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.
Thanks a lot, It works 🙂
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.
User | Count |
---|---|
84 | |
73 | |
67 | |
42 | |
35 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |