Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello, I'm looking to calculate the total login time for my users. Where I'm stuck is they sometimes need to access different servers while they're here and I end up logging the same periods multiple times. My data looks like this:
I made a report with example data and the expected output: https://drive.google.com/file/d/1OvcE6Tw7nT2maus3GylRY3JjSi41Wvzm/view?usp=sharing
Thank you for your help.
HI @G_Russo,
You can add a column to your table to get the different from start end time and convert them to total seconds.
DATEDIFF function (DAX) - DAX | Microsoft Learn
After these steps, you can use user id as condition to aggregate thee second values and convert them back to the time string.(current power bi data model table does not support duration type values)
Regards,
Xiaoxin Sheng
Thank you for your reply @v-shex-msft ,
If I understand correctly this would only give me the total sum of time difference, that's how I originally calculated the HOURS column. What I'm looking for is a way to account for simultaneous logins such that if I'm logged into two servers at once for say 4 hours, the result is 4 hours and not 8.
Hi @G_Russo,
So you means these records may include intersection parts so you need to exclude the duplicate calculations?
If that is the case, you can filter the records based on current group and aggregate them to get the min and max time to calculate the unique difference. Then you can summary these results to get the correct total.
All the secrets of SUMMARIZE - SQLBI
Regards,
Xiaoxin Sheng
I thought of this but it doesn't account for gaps in between login periods.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |