ranking based on multible criteria

Fahadfx

New Member
Joined
Mar 5, 2013
Messages
11
HI,
I have a table like this
ID date method

1 6/4/2014 P
1 10/26/2014 P
1 8/27/2014 C
2 7/10/2014 P
2 1/16/2014 C
3 8/12/2014 P
3 4/30/2014 P
3 3/17/2014 C
3 6/4/2014 C
3 8/31/2014 C

I want to rank each ID and method based on date where the result would be like this

ID date method Rank
1 6/4/2014 P 1
1 10/26/2014 P 2
1 8/27/2014 C 1
2 7/10/2014 P 1
2 1/16/2014 C 1
3 8/12/2014 P 2
3 4/30/2014 P 1
3 3/17/2014 C 1
3 6/4/2014 C 2
3 8/31/2014 C 3

I have been able to rank the ID only based on date using this dax
=RANKX(FILTER(ALL(table),table[ID]=EARLIER(table[ID])),table[date],,1)

I hope this is clear for you.
Thanks

 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I'm not 1000% sure what you want, but I think this is it?
Code:
=RANKX (
    FILTER (
        ALL ( TABLE ),
        TABLE[ID] = EARLIER ( TABLE[ID] )  && TABLE[Method] = EARLIER ( TABLE[Method] )
    ),
    TABLE[date],,1
)
Just adding the extra test for Method being the same?
 
Upvote 0

Forum statistics

Threads
1,224,051
Messages
6,176,088
Members
452,704
Latest member
Michael AA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top