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
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
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.