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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

RANKX Help

I am trying to create a measure to create a ranked column for a table.

 

Table Name: vCallBackBC (See image below for columns)

 

The rank will be determined in order by the data in the following columns:

1st) Cycle

2nd) Hire Date

3rd) Name

 

Here is the DAX I have thus far:

BC Rank = RANKX(vCallBackBC,[Cycle],,DESC)
 
( I know this is only looking at one of the three columns I need to sort by, but I wanted to at least sort by [Cycle] first to make sure it works before adding the other columns.) 

 

BUT I keep getting an error: "A single value for column 'Cycle' in table 'vCallBackBC' cannot be determind. This can happen when a meansure formula refers to a column that contains many value without specifying an aggregation such as min, max, count, or sum to get a single result

 

Help pic.png

 

Any clues? I'm sure my DAX is missing something...

8 REPLIES 8
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Is the above answer helpful to you? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could modify the mesaure as follows:

Measure = RANKX(ALL(vCallBackBC),CALCULATE(MAX([Cycle])),,DESC)

If you want to base it on three columns, try it:

BC Rank =
RANKX (
    ALL ( vCallBackBC ),
    RANKX ( ALL ( vCallBackBC ), CALCULATE ( MAX ( [Cycle] ) ),, DESC ) * 10000
        + RANKX ( ALL ( vCallBackBC ), CALCULATE ( MAX ( [Hire Date] ) ),, DESC ) * 100
        + RANKX ( ALL ( vCallBackBC ), CALCULATE ( MAX ( [Name] ) ),, DESC ),
    ,
    ASC
)

The final output is shown below:

vyalanwumsft_0-1627891118455.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Additionally, the first input of the RANK() should be with the ALL or ALLELECTED function

BC Rank = RANKX(ALL(vCallBackBC),[Cycle],,DESC)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

There are only 3 values in the [Cycle] column, 16, 17, and 18,...that's the main sorting criteria, then using Hire Date as a tiebreaker, Name is the final tiebreaker. I hope that helps.

@Anonymous That's fantastic, but if you reference a column in a measure, you still need an aggregator, even if you only have a single value in that column or even just a single row in the table. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Probably need an aggregation function around your [Cycle], like MAX([Cycle]. This is a fun read:

To *Bleep* with RANKX! - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I'm not sure which aggregation to use. Starting to think i'm not cut out for DAX...

@Anonymous Doesn't matter the aggregation, I tend to use MAX.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors