Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

dynamic ranking by sorting

Hello all,

I have built a ranking by delivery quantity. As in the image. But now I want that the ranking is automatically adjusted according to my sorting. So if I sort it by the last 14 days the rank is displayed again with 1,2,3 ....

 

 

It should not look like this, but then start again with 1.

 

Thanks!

 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    amitchandak 

    Yes, I want to have a ranking which is always based on the current sorting of the table.

    So it would also go a simple counting of the table columns from top to bottom. Is this possible?

  • Hi:

    Do you already have a measure for Delivery Quantity?

    Are you ranking Countries or Products, etc? f so it's great if your model has unique dimension tables to connect to your fact table. Also the Date Table should be the source of your date slicer.

    Something like

    Total Delivered Units = SUM(Table[Total Shipments])  (this will be used in ranking measure.) 

    Rank = RANKX( ALL( Table[Cat_id_code] ), [Total Delivered Units],, DESC )
    * see note below on Customer ranking by Sales.
     
    If you have a data model with customer, product, etc dimension tables a good way to rank, say customers by sales is:
    Rank = RANKX( ALL( Customer[Customer Names] ), [Total Sales],, DESC )
     
  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

    I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

    If you need more help, please let me know.

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.