Forum Discussion
community_pinki
4 years agoHelper II
TopN+Others using Pie chart
Hi All, I have a Pie chart where each sub-category contributing to the total sales. Now, I have a requirement that the pie chart should show only top 5 sub-category and remaining should be in Other...
- Anonymous4 years ago
I think you can build a calculated column by DAX to show new subcategorys with Top5 and Others.
My Sample:
Top5 Flag is a calculated column.
Top5Flag = VAR _Rank = RANKX ( 'Table', CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[SubCategory] = EARLIER ( 'Table'[SubCategory] ) ) ), , DESC, DENSE ) RETURN IF ( _Rank <= 5, 'Table'[SubCategory], "Others" )Result:
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
4 years agoSuper User
Check this detailed explanation about how to create the dinamic others part then you can use in any chart.
https://blog.gbrueckl.at/2019/05/power-bi-dynamic-topn-others-with-drill-down/