I have a report that is grouped by CompletionID. Each completion ID has a production record for each date. I need to average the most recent 7 days of production greater than 0 for each completion. I tried using a running total to limit the number of records for each completion ID to the 7 most recent, but I can't figure out how to average the production for only the most recent 7 dates.
Completion ID 2246 01/26/2013
14.81
01/25/2013
8.73
01/24/2013
13.29
01/23/2013
11.78
01/22/2013
13.98
01/21/2013 12.44
01/20/2013
40.64
Completion Avg 5.85
The completion average for the 7 dates selected should be 16.52, not 5.85.
Thanks in advance for your help!