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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.