Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi everyone, I'm fairly new to DAX so I could use all the help I can get here. I found the DAX definition for Moving/Rolling Average as below :
Solved! Go to Solution.
Hi, @Anonymous
please try the below measure.
Rolling Average =
VAR LastDate_ =
LASTDATE ( Query1[date] )
RETURN
IF (
ISBLANK (
CALCULATE (
SUM ( Query1[OI_Prediction_Month] ),
DATEADD ( Query1[date], -3, MONTH )
)
),
BLANK (),
CALCULATE (
AVERAGEX (
VALUES ( 'Calendar'[MonthInCalendar] ),
CALCULATE ( SUM ( Query1[OI_Prediction_Month] ) )
),
FILTER (
ALL ( Query1 ),
Query1[date] <= LastDate_
&& Query1[date] > DATEADD ( LastDate_, -3, MONTH )
)
)
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hi, @Anonymous
please try the below measure.
Rolling Average =
VAR LastDate_ =
LASTDATE ( Query1[date] )
RETURN
IF (
ISBLANK (
CALCULATE (
SUM ( Query1[OI_Prediction_Month] ),
DATEADD ( Query1[date], -3, MONTH )
)
),
BLANK (),
CALCULATE (
AVERAGEX (
VALUES ( 'Calendar'[MonthInCalendar] ),
CALCULATE ( SUM ( Query1[OI_Prediction_Month] ) )
),
FILTER (
ALL ( Query1 ),
Query1[date] <= LastDate_
&& Query1[date] > DATEADD ( LastDate_, -3, MONTH )
)
)
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hi Jihwan, much thanks. 😊 Once I read you DAX code, it came to me that the solution's quite simple. Guess I need more practice with DAX to catch up.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 130 | |
| 129 | |
| 59 | |
| 48 | |
| 47 |