MDX - TopCount plus 'Other' or 'The Rest' by group (over a set of members)
I've got requirement to display top 5 customer sales by customer group, but with other customers sales within the group aggregated as 'Others'. Something similar to this question , but counted separately for each of customer groups. According to MSDN to perform TopCount, over a set of members you have to use Generate function. This part works ok: with set [Top5CustomerByGroup] AS GENERATE ( [Klient].[Grupa Klientow].[Grupa Klientow].ALLMEMBERS, TOPCOUNT ( [Klient].[Grupa Klientow].CURRENTMEMBER * [Klient].[Klient].[Klient].MEMBERS , 5 , [Measures].[Przychody ze sprzedazy rzeczywiste wartosc] )