Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
So the measure i have attached is a measure that takes the average for the last 12 month. So e.g for february it takes the last 12 month before and creates an average of that. This has worked fine so far. But now a new department is added (PIM). This department only has observation 3 month back, which will create a wrong average because its divded by 12. Instead i want it to be divided by 3, but the other departments should be an yearly average. Is this possible?
Solved! Go to Solution.
@stherkildsen , Try a measure like given example
Rolling 12 Avg = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-12,MONTH)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH), not(isblank((Sales[Sales])))))
not isblank is important to force count of available data
@stherkildsen , Try a measure like given example
Rolling 12 Avg = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-12,MONTH)) ,
CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH), not(isblank((Sales[Sales])))))
not isblank is important to force count of available data
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
26 | |
20 | |
14 | |
8 |
User | Count |
---|---|
73 | |
47 | |
45 | |
17 | |
17 |