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
Ruedi007
Frequent Visitor

RankX - Value cannot be determined Either the column does not exist or there is no current row

I try to use rankx on my dataset that is

 

StateInhabitantsCity
California3792621Los Angeles
Texas2325502Housten
Texas1345047Dallas
California1301617San Diego
California494665Fresco
Missouri314627St Louis
Missouri130752Columbia

 

according to some tutorials (1, 2) the dax for this is

 

Measure = rankx(ALLSELECTED(Sheet1), [Inhabitants],,1)
 

But even tho I use exact the same dax function with the same arguments I get the error:

 

The value for 'Inhabitants' cannot be determined. Either the column doesn't exist, or there is no current row for this column.

 

And I have no idea why that is. I changed the summarization setting to "Not summarized" but that did not change anything. In the forum ppl say that this error come from wronlgy mistaken Measure and Column Calculation but in the tutorials they all use Measure. 

 

 

 

Could anyone help me here to get this working?

 

Best!

 

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Ruedi007 

 

Use this one:

 

 

Measure 3 = rankx(ALLSELECTED(Sheet1),FIRSTNONBLANK(Sheet1[Inhabitants],[Inhabitants]),,ASC)

 

 

003.PNG 

 

Or this one:

Measure 3 = rankx(ALLSELECTED(Sheet1),CALCULATE(SUM(Sheet1[Inhabitants])))

 

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

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @Ruedi007 

 

Use this one:

 

 

Measure 3 = rankx(ALLSELECTED(Sheet1),FIRSTNONBLANK(Sheet1[Inhabitants],[Inhabitants]),,ASC)

 

 

003.PNG 

 

Or this one:

Measure 3 = rankx(ALLSELECTED(Sheet1),CALCULATE(SUM(Sheet1[Inhabitants])))

 

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

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@Ruedi007 , if you trying for a measure then should be like this

 

Measure = rankx(ALLSELECTED(Sheet1), Sum(Sheet1[Inhabitants]),,asc)

or

Measure = rankx(ALLSELECTED(Sheet1), Sum(Sheet1[Inhabitants]),,asc)

 

For Rank Refer these links - Also check column and Measure rank differ
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

lbendlin
Super User
Super User

make sure that Inhabitants is actually a number and not a text.  Also, it is advisable to use measures instead, such as 

 

i := sum(sheet1[inhabitants])

 

Measure: = rankx(ALLSELECTED(Sheet1), i)

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.