Forum Discussion
DataSkills
Resolver I
1 year agoRankx should be easy! Why doesn't this work?
I am attempting to create the simplest of Rank measures! I have a single table (SalesData) of data, with a column called "Cost of Sales". I want to create a basic rankx function which ranks a dim...
- 1 year ago
Hello,
You were on the right track by using ALL. The only issue now is that since you remove all filters the values are same for all rows so every row returns one. By adding a column reference the calculation should work. E.g. all(SalesTable[Region])
I recommend checking this article by SQLBI: Introducing RANKX in DAX - SQLBI
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
DataSkills
Resolver I
1 year ago Thank you ValtteriN .
So this was the solution:
rankx(all(SalesTable[Region]), CALCULATE(sum(SalesTable[Cost of sales])))
or using the measure:
rankx(all(SalesTable[Region]), [COS Measure])