Filter Visual on Rank Basis

Hi All,

Problem Statement: Find TOP 5 Products on the basis of TotalSales

I wrote RANKX function for ranking the Products based on TotalSales
But when I try to filter the TOP5 Products on the basis of below measure:
Product Rank as per Quantity = RANKX(ALL(Products),[Total Quantity],DESC,Dense)

I am getting some irrelevant results.
PFA screenshot


I am also attaching my pbix file
Power BI Accelerator -Week 1 MyFile.pbix (8.6 MB)

Hello,

You have to use Total Quantity Measure in TopN filter to have a relevant results
image

or change it for bottom if using you rankx measure
image

Thanks for your reply and explanation

But could you please explain “Why Bottom 5”?
As per my understanding RANK column is sorted as 1,2,3,4,5,… so why are we giving the filter as TOP N with “Show Items” as “Bottom”?

Becuase in TopN filter, when you select top, you are telling that the bigger the number, then higher you rate it. In case of you rankX, it is the opposite, you are rating higher product with rank 1 not rank 60.

Hopes that it clears things up a little

1 Like

Thanks you so much for your explanation.
It is very nice that you provided such a detailed explanation.

Once again thank you so much

Regards
Nisha