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.
Hello
I want to calculate average from last 3 months for some products
My data looks like:
I have different products A and B with different amount of rows. My last 3M are from 202109 to 202111. For the max value from Year&Month I want to get average from last 3 dates(202109-202111) and I dont want to get average for other dates (0).
How to do it?
I have tried to do as this formula, but it shows 202111 for A - 13655, for B - 6862.
Solved! Go to Solution.
@KVPro , With Date Table and Value Meausre
AVG 3M =
CALCULATE(
AVERAGEX(Value('DATE'[Month Year]),[Value]),
DATESINPERIOD('DATE'[Date],MAX('DATE'[Date]),-3,MONTH)
)
@KVPro , With Date Table and Value Meausre
AVG 3M =
CALCULATE(
AVERAGEX(Value('DATE'[Month Year]),[Value]),
DATESINPERIOD('DATE'[Date],MAX('DATE'[Date]),-3,MONTH)
)