MAT (Moving Annual Total), YTD (Year to date) calculation using BottomCount, Tail, Properties function in MDX

I was just trying to create two calculated memebers (MAT1, MAT2)¬†under period dimension in my cube and came up with this solution. First, I am trying to explain¬†MAT1 and MAT2. MAT1 : Last 12 months from the current month. If the current month is Jun’2011, MAT1 will be the months from Jul’2010 to Jun’2011. MAT2: … More MAT (Moving Annual Total), YTD (Year to date) calculation using BottomCount, Tail, Properties function in MDX