Forum Discussion
vivivera
5 years agoNew Member
7 days rolling average Dax function output are the same value as the original input
Hi all, I was trying to calculate 7 days Rolling average PowerBi and here is my codes: Trt7dayRA = VAR __LAST_DATE = LASTDATE('Torontodaily'[Date].[Date]) RETURN AVERAGEX...
- Anonymous5 years ago
Hi vivivera
I think your dax may work in measure. If you want to build a calcualted column, you can try my way.
C.ROlling 7 Days Avg = AVERAGEX ( FILTER ( Torontodaily, Torontodaily[Date] >= EARLIER ( Torontodaily[Date] ) - 6 && Torontodaily[Date] <= EARLIER ( Torontodaily[Date] ) ), Torontodaily[Trttoday] )Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
littlemojopuppy
Community Champion
5 years agoHi Vera -
Here's the DAX I use for a rolling seven day total for Active Users. You want to substitute an expression for AVERAGE() where I have [Active Users]
CALCULATE(
[Active Users],
DATESINPERIOD(
'Calendar'[Date],
LASTDATE('Calendar'[Date]),
-7,
DAY
)
)