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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Employee
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
Employee
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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.