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 column chart the x is date and the y is max of a numberic, the legned is the object type(contain 25 types every day). I only want to show object type of the top 3 y value
Solved! Go to Solution.
@Anonymous
Sample Table
| Category | Product | Sales |
| A | A1 | 200 |
| A | A2 | 250 |
| A | A3 | 300 |
| A | A4 | 350 |
| A | A5 | 400 |
| B | B1 | 450 |
| B | B2 | 500 |
| B | B3 | 550 |
| B | B4 | 600 |
| B | B5 | 650 |
| B | B6 | 700 |
SalesValue = SUM(CPS[Sales]) Rank =
var _selectedCategory= SELECTEDVALUE(CPS[Category])
var _rank=RANKX(FILTER(ALL(CPS),CPS[Category]=_selectedCategory),[SalesValue])
return _rank
Now apply the visual level filter. (show item when the value: Rank is less than or equal to 3)
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
It's working for me. But why distance of each columns are too far and not aligned?
Thanks but that's not I want, I want to show top 3 types in every date.
@Anonymous
You have to create one measure for ranking.
Refer to this- https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
If you are still confused, please share your sample table and expected output.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
@Anonymous
Sample Table
| Category | Product | Sales |
| A | A1 | 200 |
| A | A2 | 250 |
| A | A3 | 300 |
| A | A4 | 350 |
| A | A5 | 400 |
| B | B1 | 450 |
| B | B2 | 500 |
| B | B3 | 550 |
| B | B4 | 600 |
| B | B5 | 650 |
| B | B6 | 700 |
SalesValue = SUM(CPS[Sales]) Rank =
var _selectedCategory= SELECTEDVALUE(CPS[Category])
var _rank=RANKX(FILTER(ALL(CPS),CPS[Category]=_selectedCategory),[SalesValue])
return _rank
Now apply the visual level filter. (show item when the value: Rank is less than or equal to 3)
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Thanks so much, it fixs my problem!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |