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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello PBI community.
Any experts to guide me on how to break down the DAX code to calculate the Exponential Moving Average for 30 days?
Thanks a lot
RJRO
Solved! Go to Solution.
HI @RAFAJRO,
You can create a variable to store the current axis date and use it as conditions to filter on your fact table records and get rolling average based on specific date ranges.
formula =
VAR currdate =
MAX ( Calendar[Date] )
RETURN
CALCULATE (
AVERAGE ( Table[Amount] ),
FILTER ( ALLSELECTED ( Table ), [Date] >= currdate - 30 && [Date] <= currDate )
)
Regards,
Xiaoxin Sheng
HI @RAFAJRO,
You can create a variable to store the current axis date and use it as conditions to filter on your fact table records and get rolling average based on specific date ranges.
formula =
VAR currdate =
MAX ( Calendar[Date] )
RETURN
CALCULATE (
AVERAGE ( Table[Amount] ),
FILTER ( ALLSELECTED ( Table ), [Date] >= currdate - 30 && [Date] <= currDate )
)
Regards,
Xiaoxin Sheng