Selecting the average of the top percent of duration, grouped by minute
Start by working out the duration per minute:

select sum(duration) as dpm,  datediff(minute, '2015-06-5 13:00', time) as mins_since_start 
from table
where time &gt;= '2015-06-5 13:00' 
and time &lt; '2015-06-5 14:00'
group by datediff(minute, '2015-06-5 13:00', time)


Now get the top 5 percent of this.

select top (5) percent sum(duration) as dpm,  datediff(minute, '2015-06-5 13:00', time) as mins_since_start
from table
where time &gt;= '2015-06-5 13:00' 
and time &lt; '2015-06-5 14:00'
group by datediff(minute, '2015-06-5 13:00', time)
order by dpm desc


Then wrap it up and get the 

select AVG(Q.dpm) Avg5Perc
FROM
(select top (5) percent sum(duration) as dpm,  datediff(minute, '2015-06-5 13:00', time) as mins_since_start
from table
where time &gt;= '2015-06-5 13:00' 
and time &lt; '2015-06-5 14:00'
group by datediff(minute, '2015-06-5 13:00', time)
order by dpm desc
) Q;


This then gives you the average of the top five percent. I prefer to use datediff like this because it means you're not restricted to a single hour.