Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Adding calculated row numbers to simple dataset

consider this basic table;

 

CustomerDateCallIDDesiredRowNumber
A20180109450041
A20180110545962
A20180111454453
A20180112422314
A20180112524545
A20180114546006
A20180127157197
B20180904546021
B20180904864412
B20180904546043
B20180915684874
B20180927546065
B20180929265446
C20180909546081
C20180909465842
C20180909546103
C20180930678664


I need the row numbers as per DesiredRowNumber as a calculated column. iv not included any other fields from the actual table because im only interested in ordering rows by the Date and by customer. It should be in the order of the date.

  • Anonymous Please add an "Index" field in Power Query and then add the below logic as new column in Data pane.

     

    Rno = RANKX(FILTER(Test145RowNo,Test145RowNo[Customer]=EARLIER(Test145RowNo[Customer])),Test145RowNo[Index],,ASC,Dense)

     

     

     

1 Reply

  • PattemManohar's avatar
    PattemManohar
    Icon for Community Champion rankCommunity Champion

    Anonymous Please add an "Index" field in Power Query and then add the below logic as new column in Data pane.

     

    Rno = RANKX(FILTER(Test145RowNo,Test145RowNo[Customer]=EARLIER(Test145RowNo[Customer])),Test145RowNo[Index],,ASC,Dense)