Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
75 | |
54 | |
37 | |
31 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |