Forum Discussion

kattlees's avatar
kattlees
Icon for Post Patron rankPost Patron
8 years ago
Solved

Get average minutes late

I have a field that calculates how many hours and minutes late something is.  

Schd time - actual time

 

It is stored in a column formated as H:mm

 

what I want to do is get an average time in minutes of late cases.  So my total late time is 8hours and 38 minutes for 19 cases.

 

how do I do the calculation to get an average late time of 27 minutes?

 

  • I found a solution.

     

    I did TotalLateMinutes = HOUR(patientinfo[TimeToSurgery])*60+MINUTE(patientinfo[TimeToSurgery])

    then took that divided by number of late cases.

4 Replies

  • Hi,

     

    May be something like this

     

    =SUM(Data[Late])/CALCULATE(DISTINCTCOUNT(Data[Case id]),Data[Late]>0)

     

    Hope this helps.

    • kattlees's avatar
      kattlees
      Icon for Post Patron rankPost Patron

      Here are the values:

      Late Cases = 19

      Sum of TimetoSurgery is TotalLateTime = 8:38 hours:minutes

       

       

      LateTimeMin = sum(patientinfo[TimeToSurgery])/[LateCases] - this gets me .01

      AverageLateTime = TotalLateTime/LateCases - this gets me 1.08

       

      I need the final value to be in minutes... this one should be 27minutes  8:38 = 518 minutes / 19 cases = 27.26 minutes

      • kattlees's avatar
        kattlees
        Icon for Post Patron rankPost Patron

        I found a solution.

         

        I did TotalLateMinutes = HOUR(patientinfo[TimeToSurgery])*60+MINUTE(patientinfo[TimeToSurgery])

        then took that divided by number of late cases.