March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am not sure how to mention this. I have a simple table as below. I am trying to get the rank basis on 'Name' Column which has duplicate record. Can any one help whether this can be achieved in power bi? Thanks in Advance.
Name | Desired Output (Rank) |
A | 1 |
A | 2 |
A | 3 |
A | 4 |
B | 1 |
B | 2 |
B | 3 |
C | 1 |
C | 2 |
C | 3 |
C | 4 |
C | 5 |
C | 6 |
Solved! Go to Solution.
Hi @Anonymous
Once you've added your index column, you can use the DAX expression below to create your rank column:
Rank =
VAR RowName = Table1[Name]
VAR Result =
RANKX(
FILTER(
ALL( Table1 ),
Table1[Name] = RowName
),
Table1[Index],
,ASC
)
RETURN Result
Best regards,
Martyn
Create one index column and then create one more column as below.
I have a similar problem with ranking. What I need is to have all channel_grouping_1 have the same rank. Offline Only 1 across all lines, Direct 2 across all lines etc. Can anyone help?
Many thanks
Hi @Anonymous
the easiest way is to add a Custom Index Column in Power Query Editor mode
then try to create a calculated DAX column like
RANK =
var _RowsBefore = COUNTROWS(FILTER('Table', 'Table'[Name]<EARLIER('Table'[Name])))
RETURN
rankx(FILTER('Table', 'Table'[Name]=EARLIER('Table'[Name])), 'Table'[Index],,ASC) + _RowsBefore
Hi @Anonymous
Once you've added your index column, you can use the DAX expression below to create your rank column:
Rank =
VAR RowName = Table1[Name]
VAR Result =
RANKX(
FILTER(
ALL( Table1 ),
Table1[Name] = RowName
),
Table1[Index],
,ASC
)
RETURN Result
Best regards,
Martyn
Create one index column and then create one more column as below.
Hi @Anonymous
Perfect, This is also a solution to my concern. Thanks a lot for your help.
Regards,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
12 | |
9 | |
7 |
User | Count |
---|---|
38 | |
32 | |
28 | |
12 | |
11 |