Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 @ashisha11
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 @ashisha11
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 @ashisha11
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,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |