the reason this is hard in databases, is determining what constitutes 10 previous records.
Databases are predicated on sets of data, without any employed sort order. In order to average 10 records, you need to have a set of 10 records
So rather than the "10" previous, it is easier for a database to average, say, all records from the previous 1 month, say, however many records that may be.
It is often better to reconsider the request. ie - Why average exactly 10 records in particular?