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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
JimSales81
Frequent Visitor

Rank Based on Measure

I'm putting together a stack rank for my sales dept.  


I have 10 measures, things like:

1.) Total Sales

2.) New Customers

3.) % to Quota

4.) % of Total Sales is our Newest Product

Etc.

 

I now want to rank each measure 1st to last and total the Rank for each Measure.  The person with the lowest combined score will be ranked first.  How can i do it? Can i make it dynamic?  I.e. use the same Rank Measure to rank the Area Directors, the Regional Directors, and the Territory Sales People ?  

 

Thank you!

1 ACCEPTED SOLUTION
mark_endicott
Super User
Super User

@JimSales81 

 

You can use RANK to do this, and it is fully dynamic an example of this would be below:

 

RANK(DENSE, ALLSELECTED( **** ) , ORDERBY( **** ,ASC), LAST, PARTITIONBY( **** ))

 

Inside the ALLSELECTED, you must put any columns you would like to Rank by, if you are ranking people then this column must go here - and any other column you intend to use in your visual. 

 

Inside the ORDERBY is the measure you wish to rank. 

 

PARTITIONBY is optional, and gives you the freedom to reset the rank at certain points, for example you wanted a rank within each Area Director. If you do not need to break your rank at certain parts, simply remove:

 

, PARTITIONBY( **** )

If this works for you, please mark it as the solution. 

View solution in original post

1 REPLY 1
mark_endicott
Super User
Super User

@JimSales81 

 

You can use RANK to do this, and it is fully dynamic an example of this would be below:

 

RANK(DENSE, ALLSELECTED( **** ) , ORDERBY( **** ,ASC), LAST, PARTITIONBY( **** ))

 

Inside the ALLSELECTED, you must put any columns you would like to Rank by, if you are ranking people then this column must go here - and any other column you intend to use in your visual. 

 

Inside the ORDERBY is the measure you wish to rank. 

 

PARTITIONBY is optional, and gives you the freedom to reset the rank at certain points, for example you wanted a rank within each Area Director. If you do not need to break your rank at certain parts, simply remove:

 

, PARTITIONBY( **** )

If this works for you, please mark it as the solution. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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