Hello. I have I created a calculated field to put a 30 day moving average on a line chart. The formula works, but I’d like for someone to double check it since this is the first time I’ve done this formula.
windowAvg({View Count},[{View Created At} ASC],30,0)
Also, how would I turn this line chart into a KPI that shows the last 30 days each day?
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?
We could try something simple at first. Create a KPI and then add {View Count}to the value field well and {View Created At} to the date trend field well. For the view count average, you may want to pre calculate so you can reuse the calculation else where. (You might also be able to get away with the field well aggregation.)
Then in filters on the visual, create a relative date filter using {View Created At} and set the condition to last 30 days.
Let me know if this works or if you get any weird values coming back.