Forum Discussion
wrong rank in negative values
- 8 years ago
giorgiokatr what about :
First create a measure to sum [Total USD], like :
Sum_USD = SUM(temp[Total USD])
Then rank all table and use the last measure as expression:
Rank = RANKX(ALLSELECTED(temp),[Sum_USD],,ASC,Dense)
No filters applied
Filter
cat = {a,b}
filter
firstCat={1} and
cat={b,c}
In this way you will rank the values according to what is selected.
thanks Bordalos it works ok but the problem is when you have an upper hierarchy in the cat and you filter it.
example
try this in a power bi
and create two slicers one for first cat and a second for cat
if you filter by first cat (example first cat =1)
u will see wrong rank for
RANKX(ALLSELECTED(temp[cat]),[Total USD],,ASC,Dense)
| first cat | cat | Total USD |
| 1 | a | 50 |
| 1 | b | 20 |
| 1 | c | -10 |
| 2 | d | -20 |
giorgiokatr what about :
First create a measure to sum [Total USD], like :
Sum_USD = SUM(temp[Total USD])
Then rank all table and use the last measure as expression:
Rank = RANKX(ALLSELECTED(temp),[Sum_USD],,ASC,Dense)
No filters applied
Filter
cat = {a,b}
filter
firstCat={1} and
cat={b,c}
In this way you will rank the values according to what is selected.
- giorgiokatr8 years agoHelper V
thanks Bordalos!! that did the trick!