Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Max Events in Progress Today

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?

1 ACCEPTED SOLUTION
AlB
Super User
Super User

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

 

 

 

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

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

 

 

 

Anonymous
Not applicable

Fantastic, works like a charm. Really appreciate it!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.