Forum Discussion
Anonymous
5 years agoNot applicable
Group 'other' in TopN
Hi all, Im new to DAX and would like som help with this task that i think should be easy but i can´´t get my head around it. I would like to create a piechart with top 5 products based on a mea...
Anonymous
5 years agoNot applicable
Hi Anonymous,
You can simply use if statement with count rows function to add a category of 'top n' records.
Category=
IF (
COUNTROWS ( FILTER ( 'Table', [Amount] >= EARLIER ( 'Table'[Amount] ) ) ) <= 5,
[Product] & "",
"Other"
)
Then you can use this column and raw table amount fields with aggregate mode 'sum' to achieve your requirement.
Regards,
Xiaoxin Sheng