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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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