Forum Discussion

ohohbudi's avatar
ohohbudi
Frequent Visitor
9 years ago

RANKX with Slicers

Hi guys, am a newbie Power BI user here. I want to ask how to make a filter for Rank? 

I have total items per store report, so i want to make a slicer for rank for top 10 stores, top 20 stores, top 30 etc. I already made the new measures to count the total item per store like this :

 

items = SUMX(FactPenjualan, IF(FactPenjualan[dt_item_price] <> 0, FactPenjualan[dt_item_quantity], 0))

so, for the best 10 store, i already made a measure like this : BranchRank = RANKX(ALL(factpenjualan[store_name]),CALCULATE([items]))

But i use that "BranchRank" function only in visual levels filtering function, which i made less than 11. 

So, how i could make that function so i can have filter for top 10/20/30/etc based on that function? Thanks 

1 Reply

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Icon for Community Support rankCommunity Support

    Hi ohohbudi,

     

    In your scenario, you can follow this article to achieve your requirement: Dynamic TopN & Ranking in Power BI.

     

    Also you can use "Top N" filter type. You can place the measure "items" in By Value property, and set different Top N filters. For more information, please refer to this article: Top N filter.

     

     

    Best Regards,

    Qiuyun Yu