Is it possible to get data to sum (add) data within the preset time period?

Is it possible to get data to sum (add) data within the preset time period?

Hi everyone, just wondering if it's possible to get a widget to give me the sum of data within the preset time intervals, and refresh once the new time interval is selected?  I'm trying to do it for a rain gauge, where I might like to see the data over the last 3 weeks, then a month.....etc.........