Forum Discussion

AuroraNI's avatar
AuroraNI
Helper III
6 years ago
Solved

Create Column counting values in ascending order

Hi, Was hoping people could help.  I would like to add a column in Query editor counting the number of times a value appears in a column in ascending order (see below desired output).  I have tried ...
  • v-diye-msft's avatar
    6 years ago

    Hi AuroraNI 

     

    Add the index column first, and then add the calculated column:

    Column = CALCULATE(DISTINCTCOUNT('Table'[Index]),FILTER('Table',[Country]=EARLIER('Table'[Country])&&[Index]<=EARLIER('Table'[Index])))

     

    Pbix attached.