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
pstew12
Frequent Visitor

Get max concurrent call count by the hour

Hi Everyone,

 

I have call logs where I am trying to find the overlapping calls to figure out the max concurrent calls I have every hour. 

 

Data Example:

JoinTimeLeaveTime
3/8/18 8:01 AM3/8/18 9:38 AM
3/8/18 8:04 AM3/8/18 9:38 AM
3/8/18 9:03 AM3/8/18 9:39 AM
3/8/18 9:09 AM3/8/18 9:39 AM
3/8/18 9:23 AM3/8/18 9:29 AM
3/8/18 9:23 AM3/8/18 9:29 AM
3/8/18 9:30 AM3/8/18 9:56 AM

 

What I need to come up with is the following

Hour of day (24hr)Max Calls
01
12
22
38
42
53
67
70
84
94
103
113
124
133
145
153
163
173
184
195
204
213
222
233

 

Any ideas to point me in the right direction? I don't even know where to start.

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@pstew12 ,

 

Firstly generate a 24h series table using dax:

Hours = GENERATESERIES(0, 23, 1)

Then you can create a table like below, you can add other conditions in the switch expression.

Result Table = 
SELECTCOLUMNS (
    Hours,
    "Hour of day(24hr)", Hours[Value],
    "Max Calls", SWITCH (
        Hours[Value],
        8, CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                'Table',
                NOT (
                    HOUR ( 'Table'[JoinTime] ) >= 9
                        || HOUR ( 'Table'[LeaveTime] ) < 8
                )
            )
        ),
        9, CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                'Table',
                NOT (
                    HOUR ( 'Table'[JoinTime] ) >= 10
                        || HOUR ( 'Table'[LeaveTime] ) < 9
                )
            )
        )
    )
)

Capture.PNG

 

Please also refer to the pbix file attached.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
Syndicate_Admin
Administrator
Administrator

Hello @pstew12!

I am currently encountering the same problem you had, I need to calculate the maximum number of simultaneous calls for each hour of the day. Did you manage to get it out?

Thanks in advance.

Greetings,

Bibi

v-yuta-msft
Community Support
Community Support

@pstew12 ,

 

Firstly generate a 24h series table using dax:

Hours = GENERATESERIES(0, 23, 1)

Then you can create a table like below, you can add other conditions in the switch expression.

Result Table = 
SELECTCOLUMNS (
    Hours,
    "Hour of day(24hr)", Hours[Value],
    "Max Calls", SWITCH (
        Hours[Value],
        8, CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                'Table',
                NOT (
                    HOUR ( 'Table'[JoinTime] ) >= 9
                        || HOUR ( 'Table'[LeaveTime] ) < 8
                )
            )
        ),
        9, CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                'Table',
                NOT (
                    HOUR ( 'Table'[JoinTime] ) >= 10
                        || HOUR ( 'Table'[LeaveTime] ) < 9
                )
            )
        )
    )
)

Capture.PNG

 

Please also refer to the pbix file attached.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

I dont want to count mutually exclusive count repeatedly. For eg. if there are mutually exclusive calls like

C1 from 8:00 to 8:05 ,

C2 from 8:06 to 8:10 

C3 from 8:11 to 8:15.

 

By the method explained above for 8, it will give count =3 but I want the count as 1 

i.e. excluding mutually exclusive calls because they will be sharing the resource or license

Ok, If I want to filter by date how can I make this dynamic?

 

@pstew12 ,

 

I'm afraid this couldn't be achieved because power bi doesn't support dynamic calculate table.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

You need something like Open Tickets:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thats helpful but how can I do it over a 24 hour period? 

 

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.