Reputation: 155
I have this table in PowerBI
Name | Count | Type |
---|---|---|
A | 1 | 1 |
B | 2 | 2 |
C | 1 | 2 |
D | 2 | 1 |
How can I Rank the value of Count
column only if Type is same? i.e. have a rank when Type equals to 1, have a rank when Type is 2?
So that I get
Name | Count | Type | Rank |
---|---|---|---|
A | 1 | 1 | 2 |
B | 2 | 2 | 1 |
C | 1 | 2 | 2 |
D | 2 | 1 | 1 |
Upvotes: 0
Views: 115
Reputation: 12365
Use this calculated column
Rank =
VAR ThisType = 'Table'[Type]
RETURN
RANKX(
FILTER(
'Table',
'Table'[Type] = ThisType
),
'Table'[Count],
,
,
DENSE
)
Upvotes: 1