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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors