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
CBaisako
Regular Visitor

Ranking values in a table using RANKX measure

I have a table with the following values:

Id               Price

--------------------

1                50

2                70

3                60

4                55

5                65

 

I am trying to rank this table using a measure but I get an error "a single value for the column "Price" cannot be determined. The formula is as follows:

Measure = RANKX(ALL(Data[Id]),[Price]).

Where am i going wrong.

1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @CBaisako

 

Add a CALCULATE and SUM around the [Price]

 

Measure = RANKX(ALL(Data[Id]),CALCULATE(SUM(data[Price])))

image.png

 

and have a read of this blog on using RANKX in measures  http://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @CBaisako

 

Add a CALCULATE and SUM around the [Price]

 

Measure = RANKX(ALL(Data[Id]),CALCULATE(SUM(data[Price])))

image.png

 

and have a read of this blog on using RANKX in measures  http://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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