Question
How to show the aggregated Sales of other sub-categories other than the TOP N within each category.
For example, when showing the TOP 2 for each category, how to aggregate other sub-categories as "others"
How to show the aggregated Sales of other sub-categories other than the TOP N within each category.
For example, when showing the TOP 2 for each category, how to aggregate other sub-categories as "others"
IF RANK(SUM([Sales]))<=[TOP N] THEN MIN([Sub-Category]) ELSE "Others" END
IF RANK(SUM([Sales]))<=[TOP N] THEN SUM([Sales]) ELSE WINDOW_SUM(IF RANK(SUM([Sales]))>[TOP N] THEN SUM([Sales]) END) END
RANK(SUM([Sales]))<=[TOP N]+1