There are several examples on how to retrieve a moving average, but what about a distinct count over a moving period?
Best known example why this is useful is ... daily active users, which should give a distinct count of users over the past 24h in time granularity.