Forum Discussion
Need to Create a Rank by using Calculated Column
- 9 months ago
Hello ajaybabuinturi
Please see, if this is what you want.
You can add an Index column using Power Query:
Go to Add Column tab → Index Column → select From 1Then go to the Modeling tab and create a calculated column using the following DAX to get your desired output:
Rank = IF( NOT ISBLANK('Categories'[Opportunity]), RANKX( FILTER( 'Categories', 'Categories'[Category] = EARLIER('Categories'[Category]) && NOT ISBLANK('Categories'[Opportunity]) ), 'Categories'[Opportunity] + ('Categories'[Index] * 0.00001), , ASC, SKIP ) )Best Regards,
Muhammad YousafIf this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
Hello ajaybabuinturi
Please see, if this is what you want.
You can add an Index column using Power Query:
Go to Add Column tab → Index Column → select From 1
Then go to the Modeling tab and create a calculated column using the following DAX to get your desired output:
Rank =
IF(
NOT ISBLANK('Categories'[Opportunity]),
RANKX(
FILTER(
'Categories',
'Categories'[Category] = EARLIER('Categories'[Category])
&& NOT ISBLANK('Categories'[Opportunity])
),
'Categories'[Opportunity] + ('Categories'[Index] * 0.00001),
,
ASC,
SKIP
)
)
Best Regards,
Muhammad Yousaf
If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.