Forum Discussion
5-Day Moving Average
ripstaur
Create the following measure to calculate the 5 days moving average of daily cases. Make sure you have created a dates table and linked it to the case table. This should work when you filter by country or state.
5 Days MA =
IF( NOT ISEMPTY('Table'),
AVERAGEX(
DATESINPERIOD(Dates[Date],MAX(Dates[Date]),-5,DAY),
CALCULATE(SUM('Table'[Daily Cases]))
)
)
If this doesn't answer your question, share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?
_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon if you like this reply 🙂