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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.