Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.