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! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |