Forum Discussion
Average Time Between Calls - End Time Versus Start Time
- 9 years ago
I've figured it out.
I know the total hours worked each day from the first start time and last end time. I also know the total time for each call - the difference between start and end time. So if I total the time in call and subtract it from the total hours worked I get the total time between calls each day. Then all I need to do is divide this by the total number of calls made minus 1.
Here's the DAX solution:
TimeBetweenCalls = ((([TotalHoursWorked]-(sum('TITO Data'[TimeOnCall])/60)))/(count('TITO Data'[EntryDate])-(1*DISTINCTCOUNT('TITO Data'[EntryDate]))))*60
I need to be able to roll this up to an average for the total week so I've added in DISTINCTCOUNT of the EntryDate so the function removes 1 additional call for each day worked.
mjholland
Hi mjholland,
You can refer below steps to get daily average time.
Data table:
Calculate column:
Time Range = DATEDIFF([Start Time],[End Time],MINUTE)
Measure:
Day Average =
var currentDate=LASTNONBLANK(Sheet1[Date],Sheet1[Date])
return
AVERAGEX(FILTER(Sheet1,Sheet1[Date].[Date]=currentDate),Sheet1[Time Range])
Create two visuals to display the result:
Daily average(group by straff)
Daily average:
Regards,
Xiaoxin Sheng
Anonymous thanks for this but it's not quite what I'm looking for. I need to work out the time difference between the end of a visit and the start of the next visit.
So if a visit ends at 10:30 and the next one begins at 11:00, it has taken the staff member 30 minutes to get between appointments. I'm not interested in the length of time a staff member is in an appointment (start versus end).
Does this make sense?
MattAllington are you able to help on this one?
- mjholland9 years ago
Advocate II
I've figured it out.
I know the total hours worked each day from the first start time and last end time. I also know the total time for each call - the difference between start and end time. So if I total the time in call and subtract it from the total hours worked I get the total time between calls each day. Then all I need to do is divide this by the total number of calls made minus 1.
Here's the DAX solution:
TimeBetweenCalls = ((([TotalHoursWorked]-(sum('TITO Data'[TimeOnCall])/60)))/(count('TITO Data'[EntryDate])-(1*DISTINCTCOUNT('TITO Data'[EntryDate]))))*60
I need to be able to roll this up to an average for the total week so I've added in DISTINCTCOUNT of the EntryDate so the function removes 1 additional call for each day worked.
mjholland