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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
c_d_m
Regular Visitor

RARNKX duplicating column values and wrong when filtering

I have the follwing model:

c_d_m_1-1721352604067.png

 

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 
c_d_m_2-1721352637743.png

 

 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 
c_d_m_3-1721352693469.png

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

c_d_m_4-1721352903361.png

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

c_d_m_5-1721352986917.png

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 2
c_d_m
Regular Visitor

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

c_d_m_0-1721442420615.png

c_d_m_1-1721442459881.png

 

and this is the connection between tables 

c_d_m_2-1721442543841.png

 

 

BeaBF
Super User
Super User

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

 

BBF

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.