Custom interval fields

You need to create a custom activity stream for the record field to get it into a trace, then a custom interval field to calculate it for each interval: