I'm trying to put together a server load map based on logon and logoff times from an extract. I have two columns with date/time data storing the login and logoff times for users, and also a user ID for defining each user.
example data set
I'd like to showcase this data in a chart where I'd be able to see the concurrent users at a specific hour. Example: Case A: If a user logged on at 08:00:00 and logged off at 16:00:00 I'd like for him to have an entry for all of the hours inbetween.
Case B: If a user logged on at 08:00:00 but logged off at 10:00:00, I'd like for him to only show up during this timeframe.
I've already set up some slicers for filtering on days, so that the visuals would be understandable, but I'm unable to come up with a solution on how to extract this data from my dataset and to visualize it. I have an idea to convert the current table into another with "Hour" and "Active users" at that specific time for all hours of all days in the dataset, but I'm unsure about how to go forwards with this.
Your help/input is deeply appreciated!
Suppose you have a table Users with columns User, Login hour, Logoff hour, where hour is an integer number in interval 8..16
You can create an hour table something like
Hour = GENERATESERIES(8, 16)
This will result in a table with only column Value (you can rename it if you want) with 9 rows from 8 to 16.
Then you can write a measure:
Active users = CALCULATE(COUNT(Users[User]), 'Users'[Login hour] <= MAX('Hour'[Value]), 'Users'[Logoff hour] >= MIN('Hour'[Value]))
After that you can make a chart of dependancy of Active users by Hour:
Or you can make a list of Users with a filter set on [Active users] is non blank. Then if you slice an Hour table, you'll see in this list only that users who were logged in within the sliced time interval