Multiple Filters in bar graph

I have created a visualization to show invalid percentage using a calculated field for top 5 countries using filter like this-

Now I want ..if we have same invalid percentage I want across multiple countries, and here it crosses 5..then we should have displayed for top 5 countries by alphabetical order

what can I do for this?

Hi @Mahika_Garg,
Could you share the syntax you’re using in this calculated field?

One thing you could try out; visuals provide you with the option to sort based off multiple fields:

What if you setup so that the initial sort was by your ranking, and then the second sort is by ‘country’ and setup as ascending or descending to match your criteria

I am calculating my error percentage like this-

(sum({Invalid Records}) / sum({Total Records}))*100

And no, sort will not help since it will still show me more than 5 bars since all of them have same value of error percentage

Hi @Mahika_Garg,
Yes, so what I was suggesting is linked to a rank calculation being built to handle your filtering (instead of your . Either using the Rank function or denseRank function (most likely the standard Rank to avoid your duplicates); you can choose how it if runs in ASC or DESC (which should handle the alphabetizing).
Then use this rank to setup a filter, so that you’re only including if they show in the top 5. With rank, any duplicates should have a blank value instead of the ranking of ‘5’ therefore it would be filtered out.

Thanks Brett, it helped!

I put a filter of rank <=5 on my visual like this and it worked-

1 Like