Forum Discussion
JofrainVisda
2 years agoAdvocate I
Row Number
Hi Friends, I would like to achieve this. Is this possible with DAX? I would like to put a row number for each occurence of the column 1. Thank you in advance!
- 2 years ago
Hey JofrainVisda ,
I think you can achieve this if you are able to add a column to your table that acts as a ro identifier:
Then you can add the below DAX to create the column you are looking for:
Column = ROWNUMBER( SUMMARIZE( ALLSELECTED( 'Table') , 'Table'[item] , 'Table'[rowindex] ) , ORDERBY( 'Table'[rowindex]) , DEFAULT , PARTITIONBY( 'Table'[item] ) )RANKX will not work because of
- you have to partition by the single occurences and
- you have to consider the ties, RANKX will never provide consecutive numbers for the same value.
Hopefully, this helps to tackle your challenge.
Regards,
Tom
JofrainVisda
2 years agoAdvocate I
Hi bro,
Thank you for your answer but Tom Martens is correct. I did not get the correct output. Appreciate you man