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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Wiene24
Helper II
Helper II

Rankx

Hi,

 

I have a little problem with my RANKX.

 

Two tables are involved: Costumor and Order

 

I have a measure to calculate the total amount of the orders for each costumor:

Omzet = SUM('dba Dossier'[DBCalcTotaalVerkoopTransport])
 
Now if I want to rank all the costumors, they all give me value 1.
 
I have this measure to calculate the rank:
Omzetplaats = RANKX(ALL('dba Relatie'[DebiteurNummer]);[Omzet])
 
Ranking.PNG
 
DebiteurNummer and RelatieTelefoon are columns in the dba relatie table.
 
When I use calculated columns it works, but I don't want calculated columns because then I can't work with my slicers.
 
Later I want to do more ranks so I can get an average rank, but I only want to use the top 100 costumors based on the total sales.
 
Hope someone can help me, I've been trying to sort it out for a while now but nothing seems to work with measures.
 
Kind regards,
 
Tim Wijnen
8 REPLIES 8
v-lili6-msft
Community Support
Community Support

HI, @Wiene24 

Just try this formula:

Omzetplaats 2 = RANKX(ALL('dba Relatie'),[OMZET] )

or

Omzetplaats 3 = RANKX(ALLSELECTED('dba Relatie'),[OMZET] )

Result:

1.JPG

For your formula, if you just drag [DebiteurNummer] into visual, it will work too.

2.JPG

 

Best Regards,

Lin

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

It's getting closer, but not working completely yet!

 

Rank verschil.PNG

 

I'm using this formula now: 

Omzetplaats = RANKX(ALL('dba Relatie');[Omzet];;DESC)
 
I want the rank to change if I change my slicers, that's why I didn't use ALLSELECTED.
 
But no idea why it leaves gaps now and why some are ranked as equals.
 
Kind regards,
 
Tim Wijnen

 

Anonymous
Not applicable

Hi @Wiene24 ,

 

I am curious to know if the Ranks which shows equals have the same Debit number. this could be the reason it is causing you the equal ranks.

 

Also try the solution provided by Lin @v-lili6-msft , looking at her results , looks like thats what you may be looking for.

 

Thanks,

Tejaswi

hi, @Wiene24 

If you want the rank to change if you change my slicers, please use ALLSELECTED instead of ALL.

don't use Omzetplaats = RANKX(ALL('dba Relatie');[Omzet];;DESC)

 

If you still have problem, please share a simple sample pbix file.

 

Best Regards,

Lin

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

@v-lili6-msft @Anonymous ALLSELECTED gave me the same result as ALL

 

All the debtornumbers are unique so that can't be the problem either.

 

How do I add a PBIX file? I don't see the paperclip sign to add it.

hi, @Wiene24 

You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Lin

 

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

Hi @Wiene24 ,

 

Try this mesaure:

Omzetplaats = 

                     RANKX(

                                 ALL('dba Relatie'[DebiteurNummer]),

                                   [OMZET],

                                    ,ASC

                                  )

 

 

Thanks,

Tejaswi

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.