cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yonah
Helper II
Helper II

RANKX Not working if I add a new column

Hi everyone,
I have a Matrix-Visual, that I'm using to rank my Article (Bezeichnung) by DB3_Lagerführend.
When it's only DB3_Lagerführend and Bezeichnung , the ranking is correct. 
This is the measure I'm using:
Artikel Rank =
RANKX (
ALLSELECTED ( 'Lagerführend'[Bezeichnung] ),
[DB3_Lagerführend],
,
DESC,
DENSE
)


See Picture below,

correct.PNG

But as soon, as I add a second value, I get a wrong ranking.
See Picture below.

false.PNG

So, what is my mistake and is there a way to make sure that total is not rank.

Thanks

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @Yonah ,

try this measure

Artikel Rank =
IF(
    HASONEVALUE('Lagerführend'[Artikel]),
    RANKX (
        ALLSELECTED ( 'Lagerführend' ),
        [DB3_Lagerführend],,
        DESC,
        DENSE
        )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
mangaus1111
Solution Sage
Solution Sage

Can you please send me sample data of all the columns of your source table?

I found my mistack, if i creat the rank measure first an then use: 

IF(HASONEVALUE('Lagerführend'[Artikel]), [rank-measure]) it's working.
mangaus1111
Solution Sage
Solution Sage

Hi @Yonah ,

try this measure

Artikel Rank =
IF(
    HASONEVALUE('Lagerführend'[Artikel]),
    RANKX (
        ALLSELECTED ( 'Lagerführend' ),
        [DB3_Lagerführend],,
        DESC,
        DENSE
        )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,
if I'm using this measure all is rankd by 1.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors