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 am trying to learn the RANKX expression using a couple examples on the web but every row returns 1. I have found a couple suggested solutions, none of which have worked for me.
I have simplified my data set to just 3 rows in a <name, value> table as follows:
Name Value
A 3
B 1
C 2
I create a new measure as:
Total = SUM(MyData[Value])
Then create a new column as:
MyRank = RANKX(ALL(MyData[Name]), [Total])
I have tried ALL(MyData) and ALL(MyData[Value]) as the first argument with no luck. I have also tried computing the sum within the second argument both with and without CALCULATE, again no luck.
MyRank = RANKX(ALL(MyData[Value]), CALCULATE(SUM(MyData[Value])))
I don't know how I can possibly make this example simpler and I've exhausted all my research on this. Please help.
Solved! Go to Solution.
If you do want to use a Rank Measure in the Visual Filter you have to adjust how the sum is calculated like this...
Rank Product = RANKX ( ALL(MyData[Product] ), CALCULATE ( SUM ( MyData[Quantity] ), ALLEXCEPT(MyData, MyData[Product] ) ) )
See below...
Hope this helps!
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 |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |