First-off: Please do not share company data in any capacity, even as an image.
On to your question, are you not able to use a rank() calculation such as:
[Rank of Records] Rank([Number of Records],'desc')
Once properly scoped, you will be able to use this to perform both filtering and sorting.
See my attached workbook.
Top n example.twbx 2.4 MB
You mentioned that you are using [Region] as a filter. Do you want an overall rank of the products? Or do you want to rank them within each region? Filtering by Region may be an issue if you want an overall rank. In that case, consider using a LOOKUP filter instead.
Hope this helps.
This is incorrect. When using any table calc, you would need to set the scope as Tableau will default to Table Across or Table Down depending on the data layout.
Your method avoids using a rank so will not actually work.
And finally, check my attached workbook, I have actually covered off both a total rank which ranks everything in the wind and then sorts, and, a pane rank which does the same but at the pane level.
Maybe, you misread my post. I asked Suresh few questions, so I can understand what the problem is, since no sample data was attached. My suggestion doesn't avoid using a rank. It actually says that he should be mindful of the filters he is using which may affect the Rank output.
Thanks for your your suggestion and It is not a company data, I took some sample data .
And in my requirement I'm not applying any rank condition here, Rank is coming from data only. Here I want to show the combination of Rank 5 & 4 wise Top-5 Products as a stacked bar with respective of region filter(As I attached image in my Post). In this condition my 1st priority is to show the Rank-5 wise Top-5 products and then Rank-4. In case there is no Rank-5 in any region it has to show the Rank-4 wise top products.
I tried with multiple calculations but it's calculating only based on count of products but not based on count of Rank-5 & 4.