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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DaveAl
Frequent Visitor

RANKX Circular Reference Help

Hi All,

 

I feel like this one should be really simple, but I can't seem to work it out. I have a very basic, static table with a persons name and a score. I would like to rank those score within the individual. Example:

 

Dataset:

PersonScore
John50
John75
John50
John100
Tom50
Tom75
Tom100
Tom100
Dave50
Dave75
Sally50

Desired Result:

PersonScoreRank
Dave502
Dave751
John503
John503
John752
John1001
Sally501
Tom503
Tom752
Tom1001
Tom1001

 

If I use Rank = Rankx('Table','Table'[Score],,DESC,DENSE) it will rank all of the scores, not bound to an individual. 

 

If I use Rank = Rankx(ALLEXCEPT('Table','Table'[Person]),'Table'[Score],,DESC,DENSE) then I get a circular dependancy error. 

 

Am I missing something obvious here? I feel like I am...

 

Thanks again for all your help!

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

The ALLEXCEPT function is a bit weird when used as a table function. I you're trying to write a calculated column, I'd suggest this version instead.

 

RANKX (
    FILTER ( 'Table', 'Table'[Person] = EARLIER ( 'Table'[Person] ) ),
    'Table'[Score],, DESC, DENSE
)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

The ALLEXCEPT function is a bit weird when used as a table function. I you're trying to write a calculated column, I'd suggest this version instead.

 

RANKX (
    FILTER ( 'Table', 'Table'[Person] = EARLIER ( 'Table'[Person] ) ),
    'Table'[Score],, DESC, DENSE
)

Hi AlexisOlson,

 

Works like a charm! Thank you for the assist. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.