Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Generate consecutive calculated column from scratch

Good morning community. Today I ask for help with a calculated column for a table, where I have a customer (ID_CLIENTE) that can be repeated several times and different sales dates (FECHA_VENTA), I ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Syndicate_Admin 

    Try this code to build a calculated column. You can use Earilier function to catch current row.

    CONSECUTIVE = 
    RANKX(FILTER('Table','Table'[ID_CLIENTE] = EARLIER('Table'[ID_CLIENTE])),'Table'[FECHA_VENTA],,ASC,Dense)-1

    Result is as below.

    Best Regards,
    Rico Zhou

     

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