Forum Discussion
DanCasSan
6 years agoHelper V
Row_Number in column with DAX
Dear community: I need your support. I want to perform an equivalency of the SQL ROW_NUMBER function on one of my tables in Power BI; basically, do what I put in the image. This equivalence shoul...
- 6 years ago
Hi DanCasSan ,
You can add an index column in query editor first.
Then use the rankx function to create the calculated column.
Rank = RANKX ( FILTER ( 'Table', 'Table'[KEYRATE] = EARLIER ( 'Table'[KEYRATE] ) && 'Table'[PRDLIT] = EARLIER ( 'Table'[PRDLIT] ) ), 'Table'[Index], , ASC )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
DanCasSan
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
Refer Rank by sub Category both in 1 and 2 article and use dense option in the last argument of RankX You have also use breaking ties option