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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
thomasreick
Resolver I
Resolver I

how to write a measure to count duration of Helpdesk Calls lasting only some seconds

Hello there,

 

I need to have a hint on how to write a measure within a call center analysis , that counts number of Callid's but only for calls meeting some criteria. One of the criteria is that the duration in hh:mm:ss has to be below a defined value. the other one is wether the call had been taken by  callcenter agent (cca) or was lost due to inactivity of the cca.

 

Lost Calls <5seconds = calculate(count(Calls[CallId]), Calls[Callstatus]="Lost", Calls[CallDuration]< 00:00:05 ).

 

I do not see how to phrase the second filter 'Calls[CallDuration]< 00:00:05'.

 

Any hint or help is appreciated.

 

thx & brgds

Thomas

 

1 ACCEPTED SOLUTION

Hi,

If you have date time format for start and end you can use datediff.

E.g. modified from my last example:

ValtteriN_0-1706453771746.png

Dax:

Measure 21 = COUNTROWS(FILTER('Table (27)',DATEDIFF('Table (27)'[Start],'Table (27)'[End],SECOND)<5 && 'Table (27)'[Status]="Lost"))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
thomasreick
Resolver I
Resolver I

Hi Valtteri,

thx for your answer.

I understood your approach to extract only the seconds from the given Value of time. I did not consider that one

 

But actually I am not quite confident enough on what the data format has to be for the column holding the time consumption.

  • I have a starting Timestamp (format DateTime) and a finished Timestamp (format DateTime).
  • The difference can be interpreted as the total running time for the call.

What data format is needed for that difference (consumption-column) to  get your approach implemented?

Does it have to be DateTime or Time or Duration?

Help is appreciated.

thx

Thomas

 

Hi,

If you have date time format for start and end you can use datediff.

E.g. modified from my last example:

ValtteriN_0-1706453771746.png

Dax:

Measure 21 = COUNTROWS(FILTER('Table (27)',DATEDIFF('Table (27)'[Start],'Table (27)'[End],SECOND)<5 && 'Table (27)'[Status]="Lost"))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Good Morning Valtteri,

I figured out that using your approach will return not only the ones  with a time less or equal to 00:00:05, but on top those with e.g. 00:04:05 as well. 

 

So basically your approach was the right hint. I needed to check the raw data to see what was included. By that I figured out that all time  with Seconds <=5 had been used, not only thos lasting just only 5 s.

 

The correct definition is now:

LostCallsBelow5s =

calculate(

count(table[callid]),

table[Callstatus]="lost",

second(table[duration])<=5,

minute(table[duration])=5,

hour(table[duration])=0

 )

 

Your approach to the solution is accepted, thank you very much.

Thomas

ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

Data:

ValtteriN_0-1706385930764.png

Here two out of four rows have values that fullfill both conditions.

Dax:

Measure 20 = COUNTROWS(FILTER('Table (27)',SECOND('Table (27)'[Duration])<5 && 'Table (27)'[Status]="Lost"))

End result:
ValtteriN_1-1706386351550.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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