Hi all,
Tried to write MDX to show average balance for the year for the selected month.
2009 2 (avg bal)
01 1
02 2
03 3
existing code...
measure.[bal]/count(nonempty(date.period.currentmember.children,measures.bal))
But the above code works when year is selected with all month. But when selecting few months (month 01, 02), the result
is showing as 1.
3/3 =1 (denominator is all children for the year irrespective month selection). Need help how to get correct avg balance when selecting particular month in a year. when selecting month 02 and 03 the avg balance is 5/2 = 2.5
tried below calculation as well. still the same result.
Avg( Descendants([Date].[period].currentmember, [Date].[period].[Month])
, [Measures].[bal]
)
Thank you.