Taking the average over the past hour, and do a rolling sum?

#1

This is the query I currently have,

SELECT last("value") FROM "ups_data" WHERE ("sensor" = 'watts') AND $timeFilter GROUP BY time($__interval) fill(previous)

However, it’s not giving me the data I am expecting. I’m needing the average of all values in the current hour, and then add that to the previous hour’s average.