Forum Discussion
Jedahn
3 years agoFrequent Visitor
rolling average
Hello everyone, I'm creating rolling average for the past 3 months using quick measure but i'm getting the same number for sales every month. 1st screenshot are the columns of my dates in the sam...
Jihwan_Kim
3 years agoSuper User
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Qty 3months rolling avg: =
IF (
HASONEVALUE ( 'Calendar'[Year-Month] ),
AVERAGEX (
WINDOW (
-2,
REL,
0,
REL,
ALL ( 'Calendar'[Year-Month], 'Calendar'[Year-Month sort] ),
ORDERBY ( 'Calendar'[Year-Month sort], ASC )
),
[Qty total:]
)
)