Forum Discussion

c_d_m's avatar
c_d_m
Regular Visitor
2 years ago

RARNKX duplicating column values and wrong when filtering

I have the follwing model:

 

and a rank measure which is the following 

rankAccumlatdAmount = RANKX(ALL('codeNameTable'[Code]),CALCULATE(SUM('ammountTable'[Ammount])),,DESC,Dense)
Which works fine when im trying to do a simple table 

 

 But not okay when i put boath codes in the same table, it duplicates the value of all codes for the same codeFromAmountTable even though boath tables are related 

It works wrong when selecting a code (the rank is incorrect)

And the other table as well works wrong when selecting a code 

I tried with ALLSELECTED but it didn´t work. 

I want the following: when any of the two codes are selected the table returns only the one row with the correctly calculated ranking meaing if with all the codes it ranks 3 the it should still rank 3 when i select the code. 

Thanks!

2 Replies

  • c_d_m Hi! can you upload the pbix file in drive and share the link? 

     

    BBF

  • c_d_m's avatar
    c_d_m
    Regular Visitor

    Hi,  can´t attach but this are my two tables 

     

    and this is the connection between tables