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
dmoney7612
Helper II
Helper II

Need help with ranking expression

I am trying to create a ranking expression based on average daily sales growth for my account managers. As you can see in the below image, it is not working correctly. The expression I'm using is the following: 

Pref Supplier Rank = IF (
HASONEVALUE ( 'EC Hierarchy'[Account Manager] ),
RANKX (
ALL ('EC Hierarchy'[Account Manager]),
CALCULATE( [ADS % Growth] )))
 
If anyone has some insight with this it would be much appreciated. Thanks in advance
 

dmoney7612_0-1633100976933.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @dmoney7612 ,

 

You can refer to this article about ranking in power bi.

Since there is no data model, it is suggested to try

Pref Supplier Rank = 
RANKX (ALLSELECTED('EC Hierarchy'),[ADS % Growth],,ASC,Dense)

 

Best Regards,

Stephen Tao

 

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

10 REPLIES 10
parry2k
Super User
Super User

@dmoney7612 you have to share using one drive/google drive. You cannot attach to the post.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I'm not comfortable doing that. I thought I already explained it pretty well but I will say it again. The measure that I am trying to rank (ADS % Growth) is already a calculated measure and is not supported by the CALCULATE(SUM( DAX expression. I simply want the below percentages to be ranked appropriately (so the 333.86% would be ranked 1, the 230.68% ranked 2, etc. This is the DAX expression I currently have:

 

Pref Supplier Rank = IF (
HASONEVALUE ( 'EC Hierarchy'[Account Manager]),
RANKX (
ALL ( 'EC Hierarchy'[Account Manager] ),
CALCULATE( [ADS % Growth])))

 

Again, CALCULATE(SUM( does not seem to appropriate in this scenario

 

dmoney7612_0-1633117021267.png

 

Anonymous
Not applicable

Hi @dmoney7612 ,

 

You can refer to this article about ranking in power bi.

Since there is no data model, it is suggested to try

Pref Supplier Rank = 
RANKX (ALLSELECTED('EC Hierarchy'),[ADS % Growth],,ASC,Dense)

 

Best Regards,

Stephen Tao

 

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

This worked much appreciated!

parry2k
Super User
Super User

@dmoney7612 that reply is not very helpful 😃

 

Maybe easier share pbix file with sample data and explain what you are looking for and let's go from there. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

It says pbix is not supported when I try to drag the file in

parry2k
Super User
Super User

@dmoney7612 let's do one step at a time. Did rank work out? I think that was your original question. If yes, it worked out, what else do you want to achieve?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Not much is working right now

parry2k
Super User
Super User

@dmoney7612 check this post and fix the DAX measure accordingly. it is well explained and should solve your issue.

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Appreciate the resource but I am still having issues because the ADS % Growth that I want ranked is already a calculated measure, and therefore does not populate when using the CALCULATE(SUM( expression. I can't seem to find a workaround.

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.