Forum Discussion
apatwal
4 years agoHelper III
Issue in Rolling 4 Week Average
Hi, I am facing calculation issue in Rolling 4 Week Average; Margin (Measure) Rolling 4 Wk Average (Measure) Please find below DAX used: Rolling 4 Wk Average= IF( ISBLANK...
- 4 years ago
Hi apatwal
Here's the answerMargin 4 Week Rolling Average = VAR RelevantWeeks = CALCULATETABLE( VALUES('Calendar'[WeekEndingDate]), DATESBETWEEN( 'Calendar'[Date], MAX('Calendar'[Date]) - 28, MAX('Calendar'[Date]) ), REMOVEFILTERS('Calendar') ) RETURN AVERAGEX( RelevantWeeks, [Total Margin] )
littlemojopuppy
4 years agoCommunity Champion
Hi apatwal what's the issue? You never said what's incorrect?
apatwal
4 years agoHelper III
Sorry I missed out the screenshots.
Looks like may be I am missing something:
Thanks...
- littlemojopuppy4 years agoCommunity Champion
Hi apatwal you're not having it average anything. After the closing parenthesis for DATESBETWEEN, add a comma and then [Margin] (or the name of your measure). That should take care of it
- apatwal4 years agoHelper III
Thanks for your reply!
Ooops that was my small mistake..
But Now I am facing another issue
- littlemojopuppy4 years agoCommunity Champion
apatwal there's no need for the CALCULATE function at all. Just AVERAGEX