Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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 ....

 

JustDub_0-1651053196859.png

 

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

JustDub_1-1651053381946.png

 

Thanks!

 

 

4 REPLIES 4
v-xiaotang
Community Support
Community 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.

Whitewater100
Solution Sage
Solution Sage

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 )
 
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?

amitchandak
Super User
Super User

@Anonymous , What do you mean by sort for the last 14 days?

Rank is created on a column or set of column and measure and remains on that.(with all used in rank filter will not work, with allselected filter will work )

 

You can make it dynamic using a switch 

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors