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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
DennisA
Helper I
Helper I

Rankx with other values in table

Hello ,

I asked help on this topic before and have come a long way but still am stuck. i have put this aside for a while but wanted to continuenow.
I have a table with Ordernumber, partnumber, some other values. I created a measure indicating the results of that specific order.
I then created a RanxX to see what orders are the best ones .

 

RANKX(ALLSELECTED(POResultaten[ProdHeaderOrdNr]), [R_VerschilDraaien],,DESC)

 

when I make a simple table in a report with the Ordernumber and the rank i see (i filtered to 5) 5 records.

TableOK.PNG

When I also add the column Partcode i get a lot of records all show rank 1

TableNOK.PNG

 

What am I doing wrong??

1 ACCEPTED SOLUTION
DennisA
Helper I
Helper I

Thank you all, This didn't solve it. I googled furter and got this solutiuon:
 
[Rank Name] :=
IF (
    HASONEVALUE ( Test[Name] ),
    RANKX ( ALL ( Test[Name], Test[Value] ), [Sum Value] )
)
https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/#

View solution in original post

3 REPLIES 3
DennisA
Helper I
Helper I

Thank you all, This didn't solve it. I googled furter and got this solutiuon:
 
[Rank Name] :=
IF (
    HASONEVALUE ( Test[Name] ),
    RANKX ( ALL ( Test[Name], Test[Value] ), [Sum Value] )
)
https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/#

Pragati11
Super User
Super User

Hi @DennisA ,

 

This is because your ranking is based on just POResultaten[ProdHeaderOrdNr] column not on POResultaten[ProdHeaderOrdNr] and [PartCode] column.

 

Modify your dax to consider both the columns for getiing the Rank calculation.

https://prologika.com/dax-rank-over-two-columns/

https://community.powerbi.com/t5/Desktop/Summarize-and-Rank-by-multiple-columns-and-rows/td-p/330108

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Community Champion
Community Champion

@DennisA You may find this article helpful with RANKX - https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.