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
M_B_
New Member

Average Talk Time Issue

Hi

 

I'm trying to calculate average talk time, and am having issues where the call goes into a new day:

 

M_B__0-1635339527677.png

 

My measure is:

Duration Average =

VAR total_second =
AVERAGEX(
CallSummary,
DATEDIFF(CallSummary[wsp_ucc_AcceptedTime],CallSummary[wsp_ucc_EndTime],SECOND)
)

VAR DAXDay = INT(total_second/(24*60*60))
VAR DAXHours = MOD(INT(total_second/(60*60)),24)
VAR DAXMin = MOD(INT(total_second/60),60)
VAR DAXSec = ROUND(MOD(total_second,60),0)

RETURN DAXDay &":"& DAXHours &":"& DAXMin &":"& DAXSec

 

Can anybody see what is wrong with my formula?

 

Thanks!

4 REPLIES 4
watkinnc
Super User
Super User

Try RETURN DAXDay&":"&TIME(DAXHours, DAXMin, DAXSecond)

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Unfortunately, that still returns strange results:

M_B__0-1636017636401.png

I can see the second part of the calculation has worked correctly. The top call is indeed 17 minutes long, but the first half of the calculation is still adding almost a month to the call time...

As you can see from the next result down on my screenshot, all my other calls are accurate. It's just when the date changes mid-call it can't work it out.

Hello @M_B_ 

 

Have you tried to substract call end time with call start time and represent the value as seconds?

 

 

Hi @StenbergAleksi 

I thought that was essentially what my DATEDIFF was doing within this sum?

 

What formula would I need for a straight subtraction End Time-Accepted Time which would return a value in seconds?

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