Forum Discussion
DanCasSan
Helper V
6 years agoRow_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.
V-lianl-msft
Community Support
6 years agoHi 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.