Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello.
I have a problem with the rankx formula.
Code Name
1 Bread
2 Onion
3 Cake
4 Pizza
I have a list of products and the related code. I want to sort the name of the product by the code, not by alphabetic order.
So I arrange the column with the code.
When I make a ranking column with the rankx, it shows only 1 for the ranking as below.
Ranking Name Value
1 Pizza 10,000
1 Onion 8,000
1 Bread 5,000
1 Cake 3,000
What I want is.... when I sort the table by Value.
Ranking Name Value
1 Pizza 10,000
2 Onion 8,000
3 Bread 5,000
4 Cake 3,000
When I sort the table by Name.
Ranking Name Value
3 Bread 5,000
2 Onion 8,000
4 Cake 3,000
1 Pizza 10,000
I used the following formula. If I am wrong, please let me have the correct formula.
Calculate(rankx(product[Name], [Value], ,Desc), allselected(product[Code])
Solved! Go to Solution.
Hi, @Young_G_Han Try this:
FoodRank =
RANKX (
ALLSELECTED ( 'TableTest'[Name], 'TableTest'[Order] ),
CALCULATE ( SUM ( 'TableTest'[Value] ) ),
,
DESC
)
Hope this helps.
Hi,
Try this measure
Amount = sum(Data[Value])
Rank = rankx(all(Data[Name]),[Amount])
Hope this helps.
Hi, @Young_G_Han Try this:
FoodRank =
RANKX (
ALLSELECTED ( 'TableTest'[Name], 'TableTest'[Order] ),
CALCULATE ( SUM ( 'TableTest'[Value] ) ),
,
DESC
)
Hope this helps.
Great Thanks it is working!!
User | Count |
---|---|
98 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |