The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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)
)
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |