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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I've created a Rolling Average on sales using the quick measure feature on my date column.
I was given the pre-defined DAX code and I amended the intervals for DateAdd function so that it is dynamic and changes based on whether we look back 3, 6 or 12 months as an average using "Dynamic Rolling Average Value" as per below:
Month | R3M | Previous R3M | R6M | Previous R6M |
Jan-23 | 202470 | 202470 | ||
Feb-23 | 215690 | 215690 | ||
Mar-23 | 230155 | 230155 | ||
Apr-23 | 235618 | 202470 | 227331 | |
May-23 | 249727 | 215690 | 236112 | |
Jun-23 | 257043 | 230155 | 243599 | |
Jul-23 | 269503 | 235618 | 252561 | 202470 |
Aug-23 | 260043 | 249727 | 254885 | 215690 |
Sep-23 | 244012 | 257043 | 250528 | 230155 |
Oct-23 | 235273 | 269503 | 252388 | 227331 |
Nov-23 | 235773 | 260043 | 247908 | 236112 |
Dec-23 | 239455 | 244012 | 241733 | 243599 |
Jan-24 | 234692 | 235273 | 234983 | 252561 |
Feb-24 | 236442 | 235773 | 236108 | 254885 |
Mar-24 | 235293 | 239455 | 237374 | 250528 |
Apr-24 | 248658 | 234692 | 241675 | 252388 |
May-24 | 237097 | 236442 | 236769 | 247908 |
Solved! Go to Solution.
Based on your description, you need to create a calendar table first.
Calendar = CALENDAR(DATE(2023,1,1),DATE(2024,5,1))
Then create a relationship between data table and calendar table.
Then create a measure
PreRM =
CALCULATE (
[Rolling Average All_Sales],
DATEADD (
'Calendar'[Date],
- MAX ( 'Dynamic Rolling Average'[Dynamic Rolling Average Value] ),
MONTH
)
)
Then put the date column of calendar table and the measure to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Based on your description, you need to create a calendar table first.
Calendar = CALENDAR(DATE(2023,1,1),DATE(2024,5,1))
Then create a relationship between data table and calendar table.
Then create a measure
PreRM =
CALCULATE (
[Rolling Average All_Sales],
DATEADD (
'Calendar'[Date],
- MAX ( 'Dynamic Rolling Average'[Dynamic Rolling Average Value] ),
MONTH
)
)
Then put the date column of calendar table and the measure to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.