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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RajP
Frequent Visitor

Elapsed Time

Hi,

I'm fairly new to Power BI, and i'm trying to calculate the elapsed time between when the call comes in to the current time / time responded, taking into account business hours and weekends. 

 

For example, call comes in today at 11am and at 3.30pm the same day the elapse time would be 4 hours 30 minutes, but if a call comes in at 4pm on Friday and is responded 10am on Monday morning, the elaspe time would be 2 hours, based on a 9-5 day. 

 

Is anyone able to help please?

9 REPLIES 9
v-yangliu-msft
Community Support
Community Support

Hi  @RajP  ,

If you want to get now, you can directly change the time column to this form:

TIME =
IF(
    [Desp. Da]=BLANK(),BLANK(),
IF(
WEEKDAY([Call Date])=4&&WEEKDAY([Take Date])=7&&WEEKNUM([Call Date])=WEEKNUM([Take Date]),TIME(2,0,0),NOW()-[Call Time]))

Compare the calculated time with your index

v-yangliu-msft_0-1619684151951.png

 

 

Best Regards,

Liu Yang

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

v-yangliu-msft
Community Support
Community Support

Hi  @RajP  ,

Here are the steps you can follow:

1. Create calculated column.

Take Time =
IF(
[Fin. Dat]=BLANK(),IF([Arrival]=BLANK(),[Desp.],[Arr.]),[Fin.])
Take Time =
IF(
[Fin. Dat]=BLANK(),IF([Arrival]=BLANK(),[Desp.],[Arr.]),[Fin.])
TIME =
IF(
    [Desp. Da]=BLANK(),BLANK(),
IF(
WEEKDAY([Call Date])=4&&WEEKDAY([Take Date])=7&&WEEKNUM([Call Date])=WEEKNUM([Take Date]),TIME(2,0,0),[Take Time]-[Call Time]))

2. Result.

v-yangliu-msft_0-1619507713308.png

 

 

Best Regards,

Liu Yang

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

Thank you Liu Yang, unfortunately this doesn't resolve my issue. I need to compare Call Date and Time with 'Now()' time, so I can determine where we haven't met SLA, taking into account business hours.

Anonymous
Not applicable

Hi Pragati, I am a friend of this Power BI User, please use this link:-

 

https://drive.google.com/file/d/1SQzEKE1LRqUxrHhvly_6Gh5MOqpkffOC/view?usp=sharing 

Pragati11
Super User
Super User

Hi @RajP ,

 

Please share some sample data in a file and the required output based on this sample data.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi Pragati,

 

Thank you for coming back to me. Please see sample data below:

RajP_0-1619102537156.png

Hopefully you can see the data, but basically it shows the call date and call time, and i need to identify any calls that have not been responded to within 4 working hours. I do have a businesshour table that shows Start of the day (9am) and End (5pm), along with a calendar table as below:

RajP_1-1619102838158.png

 

 

Please let me know if you require any more info?

 

Hi @RajP ,

 

Can you share the data in a file please? Typing data in Power BI is cumbersome.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

ok, will be with you shortly

RajP
Frequent Visitor

Sorry Pragati, I'm struggling to attach the file, I've tried attaching an Excel sheet, CSV and the power BI file and it says that the file type is not supported, any ideas? 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.