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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sandman3300
New Member

Rankx issue

Dear experts,

I am trying to figure out what is wrong with my dax measure.   I don't understand why I am getting 1 for all ranks.

sandman3300_1-1663070887240.pngsandman3300_2-1663070924031.png

 

 

sandman3300_0-1663070784630.png

 

12 REPLIES 12
johnt75
Super User
Super User

You are removing the filter from the Exposure column but there is also a filter on the Observation column. Try

Ranking measure =
RANKX (
    ALL ( 'Safety stats' ),
    CALCULATE ( SUM ( 'Safety stats'[Observations] ) )
)

sandman3300_0-1663073939936.png

 

Hmm, that works for me, and notice how the Others row is now getting a value. Use Performance Analyzer to get the code generated for the table and paste it into DAX Studio. That will tell you if any other filters are being applied which might affect the results, and if you execute the query you can compare the results from DAX Studio with Power BI, which should of course be the same

sandman3300_0-1663076338206.pngsandman3300_1-1663076397221.png

 

Nothing unusual there. Is it possible to share a PBIX with any confidential information removed ?

One more piece of information I created another table 

Exposures = ALLNOBLANKROW('Safety Stats'[Exposure])
 
sandman3300_0-1663078034588.pngsandman3300_1-1663078063749.png

I used the exposure column from the newly created table.  And the ranking started working suddenly.  At this point I think it is some kind bug.

 

sandman3300_2-1663078213130.png

 

as long as its working, thats the main thing.

the other relationship going into the Safety Stats table, is that single direction or bidirectional? if its bidirectional that could be causing an issue

sandman3300_0-1663079035732.png

sandman3300_1-1663079059243.png

I just deleted all other tables.  And it is still not working.

 

that is really weird

sandman3300_0-1663079985381.png

 

I exported the table to excel and created a new power bi file with that source and It did not work.

 

I removed some other columns and then it started working.

 

I'd go for your ALLNOBLANKROW solution.

Thanks for looking into this.  I was very confused for a long time.   

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.