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 have a very simple table to test out the RANKX function shown below
countries | value |
Japan | 3456234 |
china | 23452345 |
france | 6543 |
usa | 12346 |
sinagpore | 54322 |
i'm trying to create a new column called rank, and in the column header i used the RANKX code as follow:
Solved! Go to Solution.
Hi @Anonymous ,
The syntax of RANKX function is like this format :RANKX(<table>, <expression>[, <value>[, <order>[, <ties>]]]) ,the first argument is Table but not a Filed. You can go through the link https://docs.microsoft.com/zh-cn/dax/rankx-function-dax to learn more about the RANKX .
If you need to rank the value field for every countries categories, then try to create column in DAX below.
Rank= RANKX(FILTER(Sheet1,Sheet1[countries]=EARLIER(Sheet1[countries])),Sheet1[value],,ASC,Dense)
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best regards
Amy
Thank you for your explanation Amy, it was helpful.
Hi @Anonymous ,
The syntax of RANKX function is like this format :RANKX(<table>, <expression>[, <value>[, <order>[, <ties>]]]) ,the first argument is Table but not a Filed. You can go through the link https://docs.microsoft.com/zh-cn/dax/rankx-function-dax to learn more about the RANKX .
If you need to rank the value field for every countries categories, then try to create column in DAX below.
Rank= RANKX(FILTER(Sheet1,Sheet1[countries]=EARLIER(Sheet1[countries])),Sheet1[value],,ASC,Dense)
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
You need a calculated column? Not a measure...right?
Try this as column
Rank = RANKX ( ALLSELECTED ( Sheet1[countries] ), CALCULATE ( SUM ( Sheet1[value] ), FILTER ( Sheet1, Sheet1[countries] = EARLIER ( Sheet1[countries] ) ) ) )
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 |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |