Forum Discussion
TrentSP
6 years agoFrequent Visitor
Rolling Weighted Average
I'm looking for help in trying to calculate a rolling weighted average in my dataset. Below is an example of the data I'm working with: Category Year X Y 1-Year X/Y 2-Year X/Y A 2000 ...
- 6 years ago
amitchandak
6 years agoSuper User
One of the date to refer to you fact date for reference of rollup
I typically does it like this
Rolling 2 year = CALCULATE( DIVIDE( SUM('Data'[X]), SUM('Data'[Y]) ,DATESINPERIOD('Date'[Date],ENDOFMONTH(Data[Date]),-2,Year))
Rolling 2 year = CALCULATE( DIVIDE( SUM('Data'[X]), SUM('Data'[Y]) ,DATESINPERIOD('Date'[Date Filer],MAX(Data[Date]),-2,Year))