• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to create an index column based on dates in another column

Hello

I would like to create a helper column or index column based on my reporting date. The reporting date are random. They are sometimes 4 days,7 days apart or even 10 days apart.
Secondly several rows have the same reporting date.

I want to create a helper column that gives the reporting date an ordinal number so I can use them for filtering in dax

Report Date Index
1/21/2018 0
1/21/2018 0
1/19/2018 -1
1/19/2018 -1
1/14/2018 -2
1/7/2018 -3
1/7/2018 -3
 
Maybe,

upload_2018-1-24_21-21-44.png

In B2, copied down :

=IF(COUNTIF(A$1:A1,A2),VLOOKUP(A2,A$1:B1,2,0),SUM(1,-(FREQUENCY(A$2:A2,A$2:A2)>0)))

Regards
Bosco
 

Attachments

  • IndexNumber.xlsx
    10.6 KB · Views: 7
Last edited:
Why not do it directly in DAX with the RANKX function?
RANKX(<table>, <expression>, <value>, <order>, <ties>)
Not available in V1 r2008 of PP though.
 
Back
Top