Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
Solved! Go to Solution.
Hi @alya1 ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(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:
After:
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.
Hi @alya1 ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(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:
After:
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!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
71 | |
70 | |
38 | |
28 | |
26 |
User | Count |
---|---|
98 | |
96 | |
59 | |
44 | |
40 |