Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Show top N values in clustered column chart

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

1 ACCEPTED SOLUTION

@Anonymous 

 

Sample Table

 

CategoryProductSales
AA1200
AA2250
AA3300
AA4350
AA5400
BB1450
BB2500
BB3550
BB4600
BB5650
BB6700

 

 

 

SalesValue = SUM(CPS[Sales]) 
Rank = 
var _selectedCategory= SELECTEDVALUE(CPS[Category])
var _rank=RANKX(FILTER(ALL(CPS),CPS[Category]=_selectedCategory),[SalesValue])
return _rank

 

 

 nor.JPG

Now apply the visual level filter. (show item when the value: Rank is less than or equal to 3)

 

Capture.JPG

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

7 REPLIES 7
TramLe
New Member

TramLe_0-1711942803140.png

It's working for me. But why distance of each columns are too far and not aligned?

 

nandukrishnavs
Community Champion
Community Champion

@Anonymous  You could try TopN visual level filter.

Capture.JPG



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Anonymous
Not applicable

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
🙂


Regards,
Nandu Krishna

Anonymous
Not applicable

Capture.PNG

 

@Anonymous 

 

Sample Table

 

CategoryProductSales
AA1200
AA2250
AA3300
AA4350
AA5400
BB1450
BB2500
BB3550
BB4600
BB5650
BB6700

 

 

 

SalesValue = SUM(CPS[Sales]) 
Rank = 
var _selectedCategory= SELECTEDVALUE(CPS[Category])
var _rank=RANKX(FILTER(ALL(CPS),CPS[Category]=_selectedCategory),[SalesValue])
return _rank

 

 

 nor.JPG

Now apply the visual level filter. (show item when the value: Rank is less than or equal to 3)

 

Capture.JPG

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Anonymous
Not applicable

Thanks so much, it fixs my problem!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.