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

How to calculate Average Queue Time

 How to calculate Average Queue Time

 

Rajeeb_mohanty_0-1664358500318.png

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please refer to attached sample file with the solution

1.png

Average Queue Time = 
VAR TotalTime = [Queue Time]
VAR TotalSeconds = SECOND ( TotalTime ) + MINUTE ( TotalTime ) * 60 + HOUR ( TotalTime ) * 3600 
VAR AverageSeconds = DIVIDE ( TotalSeconds, SUM ( 'Table'[Calls Queued] ), 0 )
VAR Hours = FORMAT ( QUOTIENT ( AverageSeconds, 3600 ), "00" )
VAR BalanceSeconds = MOD ( AverageSeconds, 3600 )
VAR Minutes = FORMAT ( QUOTIENT ( BalanceSeconds, 60 ), "00" )
VAR Seconds = FORMAT ( MOD ( BalanceSeconds, 60 ), "00" )
VAR Result = Hours & ":" & Minutes & ":" & Seconds
RETURN 
    Result

View solution in original post

18 REPLIES 18
tamerj1
Super User
Super User

Hi @Anonymous 
Please refer to attached sample file with the solution

1.png

Average Queue Time = 
VAR TotalTime = [Queue Time]
VAR TotalSeconds = SECOND ( TotalTime ) + MINUTE ( TotalTime ) * 60 + HOUR ( TotalTime ) * 3600 
VAR AverageSeconds = DIVIDE ( TotalSeconds, SUM ( 'Table'[Calls Queued] ), 0 )
VAR Hours = FORMAT ( QUOTIENT ( AverageSeconds, 3600 ), "00" )
VAR BalanceSeconds = MOD ( AverageSeconds, 3600 )
VAR Minutes = FORMAT ( QUOTIENT ( BalanceSeconds, 60 ), "00" )
VAR Seconds = FORMAT ( MOD ( BalanceSeconds, 60 ), "00" )
VAR Result = Hours & ":" & Minutes & ":" & Seconds
RETURN 
    Result
Anonymous
Not applicable

Hi ,

 

I was shared sample data with you, DAX was working fine , but when i am adding 2 months data it is showing wrong, Queue time is showing wrong , it will go >24 hours , for < 24 hr it is working fine.

 

for > 24 hour queue time what is the solution for that..

Hi @Anonymous 
If you add the month column to the visual it should work fine. 

1.png

Anonymous
Not applicable

rrrr.JPG

 For interval wise it is showing correct but total is showing incorrect,,

Anonymous
Not applicable

can you please check ?

komald
Helper I
Helper I

@Anonymous , Try this

create measure,
avg queue time=divide(sum(total queue time) , sum(calls queued))
put this measure in card

or

create calculated column
avg queue time= total queue time / queued calls

Anonymous
Not applicable

Hi,

Total queue time is in text format so unable to divide with call queued ..

@Anonymous , then use value function

avg queue time= value( total queue time )/ value(queued calls)
try this let me know is this work for u or not.

Anonymous
Not applicable

Hi,

 

It's not working ..

@Anonymous , can you please share your dax with error?

 

Anonymous
Not applicable

VALUE(SUM('Raw Data'[Total Queue Time])) / SUM('Raw Data'[Calls Queued]))

@Anonymous , 

komald_0-1664455600193.png

 

Anonymous
Not applicable

let me check

@Anonymous , if i ans your question please mark as a solution. Thanks

Anonymous
Not applicable

Hi,

Still it's not done , i am sharing some more raw data for more clarity.. can you please check ..

left side is raw data and right side table is output .. i wanted to show same output table..

can you please help me out..

thanks in advanced..

 

Rajeeb_mohanty_0-1664786219259.png

 

Anonymous
Not applicable

@tamerj1 ,can you please solve this..

Anonymous
Not applicable

Raw data

DateIntervalCalls QueuedTotal Queue Time
02-05-202202:00-02:30000:00:00
02-05-202202:00-02:30000:00:00
02-05-202202:00-02:30000:00:00
02-05-202202:30-02:60200:01:43
02-05-202202:30-02:60000:00:00
02-05-202202:30-02:60100:00:43
02-05-202202:30-02:60100:02:42
02-05-202202:30-02:60100:07:43
02-05-202202:30-02:60000:00:00
02-05-202202:30-02:60200:02:10
02-05-202202:30-02:60200:02:29
02-05-202202:30-02:60000:00:00
02-05-202205:00-05:30100:05:24
02-05-202205:00-05:30000:00:00
02-05-202205:00-05:30200:05:55
02-05-202205:00-05:30100:00:43
02-05-202205:00-05:30000:00:00
02-05-202205:00-05:30100:01:36
02-05-202205:00-05:30100:00:09
02-05-202205:00-05:30100:00:22
02-05-202205:30-05:60100:18:25
02-05-202205:30-05:60200:09:18
02-05-202205:30-05:60000:00:00
02-05-202205:30-05:60100:02:53
02-05-202205:30-05:60200:07:56
02-05-202205:30-05:60100:04:22
02-05-202205:30-05:60100:01:01
02-05-202205:30-05:60100:02:52
02-05-202205:30-05:60100:07:21

 

Result    
    
IntervalCalls QueuedTotal Queue TimeAverage Queue Time(Total queued / call queued)
Total261:25:470:03:18
02:00-02:3000:00:000:00:00
02:30-02:6090:17:300:01:57
05:00-05:3070:14:090:02:01
05:30-05:60100:54:080:05:25
Anonymous
Not applicable

@amitchandak, can you help me out for same

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.

Top Solution Authors