Home > Enterprise >  Numbering order of Dates for Dimension in other Column
Numbering order of Dates for Dimension in other Column

Time:01-31

I'm relatively new to DAX and I believe there should be straight forward solution for this problem.

I have ID for customers and corresponding periods, for which we have orders for them. These are not in particular order, so I need to add a column in which, for each ID, it shows me what is the first, second, third ..etc period with the customer.

see below the in the third column, what I would expect. enter image description here

since I'm new, I have not tried anything worth mentioning here, sorry

CodePudding user response:

Use this calculated column

Rank = 
VAR ThisID = 'Table1'[ID]
RETURN
    RANKX(
        FILTER(
            'Table1',
            'Table1'[ID] = ThisID
        ),
        'Table1'[start Date],
        ,
        ASC,
        DENSE
    )

enter image description here

  • Related