Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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