Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a set of data and I want to create a bar chart that returns the top 5 values and groups the rest into an "other" category.
How would I do this?
Solved! Go to Solution.
Hi,
Please try to create a rank column instead of rank measure:
Rank-Column = RANKX('Table','Table'[Revenue],,DESC,Dense)Then create a new category column:
New Category = IF([Rank-Column]<=5,'Table'[Category],"Other")Choose this [new Category] and original [Revenue] as a bar chart, it shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hi!
How does this, if it does at all, work for non values?
Say, we have a table with all the houses in town.
One column is the type of house and there are 35 different types of houses.
But 10 of them only occur once or twice.
I want to group them into a class "Other"
Can this be done too?
Kind regards,
Simone
Hi,
Please try to create a rank column instead of rank measure:
Rank-Column = RANKX('Table','Table'[Revenue],,DESC,Dense)Then create a new category column:
New Category = IF([Rank-Column]<=5,'Table'[Category],"Other")Choose this [new Category] and original [Revenue] as a bar chart, it shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hi Giotto,
I am having the same problem. I figured out with your solution that the "Rank-Column" should give me a ranking of all the items on my list from 1 to 5. But when I copied and pasted the code you gave and changed the field name to match my project, it didn't work. First the program came up with a column called "Sum of Rank-Column" that was all 1's. Then when I told it not to summarize, it said it "Can't display the visual".
@Anonymous ,For Rank Refer these links - This will how to get it. Specially the first one
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 172 | |
| 107 | |
| 92 | |
| 54 | |
| 46 |