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.
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!!
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 |
---|---|
108 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |