Forum Discussion
Need help with Rolling Sum
- 5 years ago
Hi, Anonymous
Try to create a measure like this:
Rolling Average Numerator = VAR _sum12 = CALCULATE ( SUM ( 'PowerBI(Index)'[Total Return Numerator ("calculated reutrn" tab, Column K)] ), FILTER ( ALL ( 'PowerBI(Index)' ), EOMONTH ( 'PowerBI(Index)'[Return_id], 0 ) <= EOMONTH ( MAX ( [Return_id] ), 0 ) && EOMONTH ( 'PowerBI(Index)'[Return_id], 0 ) > EOMONTH ( MAX ( [Return_id] ), -12 ) ) ) RETURN IF ( HASONEVALUE ( 'PowerBI(Index)'[Return_id] ), _sum12, SUM ( 'PowerBI(Index)'[Total Return Numerator ("calculated reutrn" tab, Column K)] ) )my sample data:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , example measure with help from date table
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD("Date"[Date ],MAX("Date"[Date ]),-12,MONTH))
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hi Amit,
Please let me know if you can access this link, not sure if you can access it. What I am trying to do is to divide the 12 month rolling sum of the total numerator by the 12 month rolling sum of the total denominator.