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

call center duration

Hello,  I have Excel data type Custom Column Number h:nn:ss from a power pivot that I have imported into Power BI. The field with duration imports as ABC 123 with data showing as 12/31/1899 12:00:01 AM. I have split the column to remove 12/31/1899 and I am let with 12:00:01 AM type is time (I do not have any PM at the end of the time). How do I convert 12:00:01 AM to use in a chart to show duration of an average time it took to answer a call? In 12:00:01 AM the call took 1 second to answer the call, another example is 12:16:29 AM the call took 16 minutes and 29 seconds to answer the call.

 

I want a line chart that shows interval as the axis, the duration of example minutes and seconds to be the value,  the legend would be the agent

also I want to use the duration in a table or card showing the the total average time it took to answer in the month of say September . For call speed to answer in September an example is average speed of answer is 5 minutes 30 seconds or  05:30

I would like to be able to do this with daily total, MTD and YTD.

can this be done?

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@llyons - I have some articles on this that I think you will find helpful:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

 


@ 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...

View solution in original post

v-alq-msft
Community Support
Community Support

Hi, @llyons 

 

Based on your desciprion, I created data to reproduce your scenario.The pbix file is attached in the end.

Table:

f1.png

 

You may create a custom column as below in 'Query Editor'.

= Table.AddColumn(#"Changed Type", "Custom", each let dur=[End]-[Start]
in
#time(Duration.Hours(dur),Duration.Minutes(dur),Duration.Seconds(dur)))

 

f2.png

 

In Power BI Desktop, you may create a calculated column as below to calculate total seconds.

TotalSeconds = HOUR([Custom])*3600+MINUTE([Custom])*60+SECOND([Custom])

 

Finally you may format the column as below.

f3.png

 

Best Regards

Allan

 

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

8 REPLIES 8
wac1ldy
Frequent Visitor

I also have a similar issue. I have a column of seconds. I pull that and others into a Matrix visualization and it allows me to aggregate or average and thay all appear in their respective columns and they filter just fine. Trouble is, I would like to show the data in the columns as hh:nn:ss. I can add measures etc. but when I pull the data into the Matrix, it will not allow an average, only a First etc. Anyone got any thoughts?

 

Thanks.

CW

v-alq-msft
Community Support
Community Support

Hi, @llyons 

 

Based on your desciprion, I created data to reproduce your scenario.The pbix file is attached in the end.

Table:

f1.png

 

You may create a custom column as below in 'Query Editor'.

= Table.AddColumn(#"Changed Type", "Custom", each let dur=[End]-[Start]
in
#time(Duration.Hours(dur),Duration.Minutes(dur),Duration.Seconds(dur)))

 

f2.png

 

In Power BI Desktop, you may create a calculated column as below to calculate total seconds.

TotalSeconds = HOUR([Custom])*3600+MINUTE([Custom])*60+SECOND([Custom])

 

Finally you may format the column as below.

f3.png

 

Best Regards

Allan

 

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

 

Thank you to everyone, especially Allan that gave me a piece that connected the dots for me. I am doing a happy dance right now! and will quickly finish up my project.  Have an awesome day

Greg_Deckler
Super User
Super User

@llyons - I have some articles on this that I think you will find helpful:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

 


@ 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...

I am a new user and have the July 2020 version of Power BI. I do not have VAR Duration.

What I was able to do is create a column with the total amount of seconds (from my original example for one row 12:00:01 AM) but now I need to convert the seconds into  time formate. I found dax Time (= TIME([intHours],[intMinutes],[intSeconds])  ) but as a new user I do not understand how to write the code to make it work. How would I get the formula = TIME([intHours],[intMinutes],[intSeconds])   to refer to my column that has the total amount of seconds for a call that I need converted to time format?  Thank you for all of your time to help me understand the time function. I wish there was a simple way to do time like in Excel.

MauriceMecowe
Resolver II
Resolver II

Hi @llyons ,

 

If I were you I'd take the following steps.

- Either keep only the right left 5 characters of your column, so you lose the '12:' or subtract by the twelve hours leaving you with '00:16:29'
- Transform the time to seconds, so you can have it as an integer value

- From here, you can easily make calculations to have it in either minutes or hours

- Use the Time Intelligene functions you've mentioned to get the desired result.

Cheers,

Maurice

what are the formulas to do the steps you prepose,excluding the charts

In order to keep the right 5 characters of a column:

 

RIGHT(Column, 5)

 

This will get you the time in seconds.

Column = MINUTE(Table[date time])*60+SECOND(Table[date time])

 

Divide this by 60 in order to get minutes etc.

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.