Formula measure calculating based on all but only showing some

Hi

I have many brands, each with a score. I need to do percentrank of each brand out of all of them. I am doing this on the dashboard using a formula measure. This gives me the percentrank of all of them, but now I need to filter to only show some of the brands. When I do this, the percentrank is now out of the ones showing, which is not what I want.

What’s the best way to keep percentrank out of all the brands, but only to show some of them in my charts/tables? The user needs to be able to select one or more brands to show, so this needs to be filterable.

I’ve been trying out placeholders, formula vizualisations, scripts etc. but not sure the best way to approach this.

Thanks

You keep the existing metric set and then define a new formula visualization that uses some type of TOP metric set setting.

What sort of Top would work in conjunction with filters? How can I get the filtered brand(s) to the top?

I have worked out something for this.

I have created a string placeholder in a formula and have connected a textbox parameter to this.
My formula looks something like

String a = $brandPlaceholder$;
if(a.IndexOf($BrandName$)>=0) 
return $PERCENTRANK BRScore Expression$

This allows me to put multiple values in the textbox parameter and only those will be shown in the new column.

I couldn’t work out how to use Split and then Contains, but this seems to work.