Forum Discussion
Yacine2025
1 year agoFrequent Visitor
Need help
Hi everyone I'm New in power bi and i need help to resolve this case. I want to calculate session duration between login and logout for each user per login date knowing that status can contains mult...
- 1 year ago
ryan_mayu
1 year agoSuper User
still not clear about the logic. could you pls update the sample data and expected output?
Yacine2025
1 year agoFrequent Visitor
Hi ryan_mayu
This is my row data
UserName TimeStamp Status
abc 2025-03-20 22:07 Login
abc 2025-03-20 22:33 Logoff
abc 2025-03-20 22:34 Login
abc 2025-03-21 02:55 Logoff
abc 2025-03-21 02:56 Login
abc 2025-03-21 10:04 Logoff
abc 2025-03-21 22:08 Login
abc 2025-03-22 09:46 Logoff
The expected result is like this
| Login | Logoff |
| 2025-03-20 22:07 | 2025-03-21 10:04 |
| 2025-03-21 22:08 | 2025-03-23 09:4 |
Its possible to have multiple login and logout for same user in the same session
Thanks
- ryan_mayu1 year agoSuper User
- Yacine20251 year agoFrequent Visitor
- Yacine20251 year agoFrequent Visitor
Hi ryan_mayu ,
Its not the expected result
This is my goal, the session cross midnight
Login
2025-03-20 22:07
Logoff
2025-03-21 10:04
Login
2025-03-21 22:08
Logoff
2025-03-23 09:4
Thanks in advance
- ryan_mayu1 year agoSuper User
what do you mean cross the midnight? what's the time period for midnight?