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 PBI Community,
I'm looking for some help on an events in progress problem.
Currently, I have a single fact table that has a Start and End column that includes date and time down to the second.
I am trying to find a way to find the max number of concurrent sessions on a given day.
For example:
Start End
1. 3/22 10:32 3/22 10:50
2. 3/22 10:44 3/22 10:56
3. 3/22 4:05 3/22 4:20
4. 3/22 4:10 3/22 4:15
5. 3/22 4:12 3/22 4:30
The answer here for this date of 3/22 would be 3 because that's the highest number of concurrent sessions going on.
That's my ultimate goal, but I still am having trouble figuring out events in progress based on time. Any hints?
Solved! Go to Solution.
Hi @Anonymous
Try this as calculated column in the table you show. Note I've named the first column 'ID'. You'll have to add the year to the dates in the Start and End columns and convert them to DateTime type.
You can then easily extract the maximum from the new calculated column.
Concurrent with this session = COUNTROWS ( FILTER ( Table1; Table1[ID] <> EARLIER ( Table1[ID] ) && NOT ( Table1[End] < EARLIER ( Table1[Start] ) || Table1[Start] > EARLIER ( Table1[End] ) ) ) ) + 1
Hi @Anonymous
Try this as calculated column in the table you show. Note I've named the first column 'ID'. You'll have to add the year to the dates in the Start and End columns and convert them to DateTime type.
You can then easily extract the maximum from the new calculated column.
Concurrent with this session = COUNTROWS ( FILTER ( Table1; Table1[ID] <> EARLIER ( Table1[ID] ) && NOT ( Table1[End] < EARLIER ( Table1[Start] ) || Table1[Start] > EARLIER ( Table1[End] ) ) ) ) + 1
Fantastic, works like a charm. Really appreciate it!
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 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |