I would recommend checking out the solution below for another moving average question. This has fairly good detail of the problem and a link to demo central:
For your KPI, are you looking for the 30 day average of a metric or do you want a metric that shows the daily average?