Forum Discussion
NicoleApple
4 years agoNew Member
7 day moving average
I am trying to urgently calculate a 7 day moving a average but im having issues. I could do it in Excel but i want to use Power BI to present the data instead and my DAX is a little rusty as i havent...
- 4 years ago
Hi,
I do not fully understand the DAX formula, but I think it has to have one more ) at the end of the formula.
7 day moving average = CALCULATE ( SUM ( 'PCR TEsting Data'[Total Volume of Tests (Excl. work in progress or tests referred out) (No.)] ) / 7, DATESINPERIOD ( 'PCR TEsting Data'[Relevant Date], LASTDATE ( 'PCR TEsting Data'[Relevant Date] ), -7, DAY ) )
Jihwan_Kim
Super User
4 years agoHi,
I do not fully understand the DAX formula, but I think it has to have one more ) at the end of the formula.
7 day moving average =
CALCULATE (
SUM ( 'PCR TEsting Data'[Total Volume of Tests (Excl. work in progress or tests referred out) (No.)] ) / 7,
DATESINPERIOD (
'PCR TEsting Data'[Relevant Date],
LASTDATE ( 'PCR TEsting Data'[Relevant Date] ),
-7,
DAY
)
)