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
alya1
Helper V
Helper V

clustered column chart with parameters as legend, how to only have 1 parameter filter by top 5?

Hi All,


I have 4 parameters that users can select for the legend of a clustered column chart: Country, Region, Model, and Color. 
x axis is month and y axis is count of buyers. 
Only when Model is selected, I wish the chart to only display Top 5 Models since there are too many. 
Does anyone have idea?

Thank you! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @alya1 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_1-1732252389911.png

(2) We can create measures. 

Measure = 
COUNTROWS(FILTER(ALLSELECTED('Table'),[Model]=MAX('Table'[Model])))
Measure 2 = RANKX(SUMMARIZE(ALLSELECTED('Table'),[Model],"count",[Measure]),[count],[Measure],DESC,Dense)
Flag = SWITCH(TRUE(),
ISFILTERED('Parameter'[Parameter Fields])=FALSE(),1,
ISFILTERED('Parameter'[Parameter Fields])=TRUE() && SELECTEDVALUE(Parameter[Parameter Fields])<>"'Table'[Model]",1,
SELECTEDVALUE(Parameter[Parameter Fields])="'Table'[Model]" && [Measure 2]<=5,1,0)

(3)Place [Flag=1] on the visual object and then the result is as follows.

Before:

vtangjiemsft_2-1732252535947.png

After:

vtangjiemsft_3-1732252576811.png

 

 

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @alya1 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_1-1732252389911.png

(2) We can create measures. 

Measure = 
COUNTROWS(FILTER(ALLSELECTED('Table'),[Model]=MAX('Table'[Model])))
Measure 2 = RANKX(SUMMARIZE(ALLSELECTED('Table'),[Model],"count",[Measure]),[count],[Measure],DESC,Dense)
Flag = SWITCH(TRUE(),
ISFILTERED('Parameter'[Parameter Fields])=FALSE(),1,
ISFILTERED('Parameter'[Parameter Fields])=TRUE() && SELECTEDVALUE(Parameter[Parameter Fields])<>"'Table'[Model]",1,
SELECTEDVALUE(Parameter[Parameter Fields])="'Table'[Model]" && [Measure 2]<=5,1,0)

(3)Place [Flag=1] on the visual object and then the result is as follows.

Before:

vtangjiemsft_2-1732252535947.png

After:

vtangjiemsft_3-1732252576811.png

 

 

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Thank you so much Neeko, this is a great and elegant solution! For some reason with "... && [Measure 2]<=5,1,0)" I get the top 6 Models so I just changed the 5 to a 4 🙂 Much appreciated! 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors