Forum Discussion

aausten22's avatar
aausten22
Icon for Helper I rankHelper I
3 years ago
Solved

Creating sequential numbering system based of Today's Month

Currently I have a dataset with a list of months formatted as "MMM YY"   What I am wanting to achieve is a numbering system as a calculated column that will add the numbers 1-12 based on the curren...
  • Ritaf1983's avatar
    Ritaf1983
    3 years ago

    Hi aausten22 
    Add to the calculated column which ranks your dates based on month-year:

    rank_Months =
    RANKX (
        'date',
        RANKX ( 'date', YEAR ( 'date'[Date] ),, DESC, DENSE ) * 100
            + RANKX ( 'date', MONTH ( 'date'[Date] ),, DESC, DENSE ),
        ,
        ASC,
        DENSE
    )

    It will work dynamically as you mentioned that you need

     

    Link to the sample file 

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