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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
PowerRon
Post Patron
Post Patron

RANKX and tie breaker

Hi

 

I am using tie breaker for the first time but can't get it working.
Maybe someone can help.


https://www.dropbox.com/scl/fi/rtv3ghfv12g1vg7fp0vmt/test.pbix?rlkey=pipd1q7kysjmok758og3bmlsg&dl=0 

If you look at the table in the attached pbix you see 4 measures:

  1. Sum Quantity. on which the table now is sorted (ascending)
  2. RankSum. For Sum Quantity value 371 the ranking is equal, being 172
  3. Rand
  4. RankRand

In measure 4 I use measure 3. I thought by using this the Rank of Fatz Group would become 173 (instead of 172) and that of SHISEIDO Ltd would become 164 instead of 163.
But that's not happening. 
I also don;t know why the Rand of Fatz Group and Voonyx Group is still the same.

Can someone help me?

Regards
Ron

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @PowerRon ,

 

Try the following code:

 

RankSum = 
RANKX(ALLSELECTED('Customers'[Customer Names]),
[Sum Quantity]+CALCULATE( SUM(Customers[Customer Index])/100)
    
,,DESC)







Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

I'd solve it with the RANK function

Measure = RANK(DENSE,SUMMARIZE(ALLSELECTED(Sales),Customers[Customer Names],"A",[Sum Quantity]),ORDERBY([A],desc,Customers[Customer Names],desc))

Hope this helps.

Ashish_Mathur_0-1703396491030.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MFelix
Super User
Super User

Hi @PowerRon ,

 

Try the following code:

 

RankSum = 
RANKX(ALLSELECTED('Customers'[Customer Names]),
[Sum Quantity]+CALCULATE( SUM(Customers[Customer Index])/100)
    
,,DESC)







Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi Miguel, thnx. It works. Why doesn't it work with RAND()? Any idea?

Regards
Ron

Because when you use the rand has a measure the value gets recalculate and usually for the metric where you reusing the value its always the same so no difference. 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.