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
Anonymous
Not applicable

Rank on a Measure

Hello,

 

I am trying to rank a table based on a measure field. 

 

In my table I have 'Region' (North, South, East, West), 'Today's Sales', 'Today's Sales Target', and '% of target achieved' (measure field).

 

I want to rank on the '% of target achieved' but I can't work out how.

 

Please help 🙂

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Hi  @Anonymous  ,

 

If you need to create a measure but not a calculated column for Rank, you can use the DAX below.


Rank = RANKX(FILTER(ALLSELECTED(Table1),Table1[Region]=MAX(Table1[Region])),Table1[% of target achieved],,ASC)

 

Best regards
Amy

View solution in original post

5 REPLIES 5
v-xicai
Community Support
Community Support

Hi  @Anonymous ,

 

Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

 

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create column using DAX below.

 

Rank = RANKX(FILTER(Table1,Table1[Region]=EARLIER(Table1[Region])),Table1[% of target achieved],,ASC)

 

Best Regards,

Amy

 

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 Amy,

 

Thanks for the message!

 

When I use the formula you said I get an error regarding the 'Earlier' part of the equation:

 

"EARLIER/EARLIEST refers to an earlier row contect which doesn't exist".

 

I've triple checked I've entered it right!

 

Any suggestions?

 

Thanks!

Hi  @Anonymous  ,

 

If you need to create a measure but not a calculated column for Rank, you can use the DAX below.


Rank = RANKX(FILTER(ALLSELECTED(Table1),Table1[Region]=MAX(Table1[Region])),Table1[% of target achieved],,ASC)

 

Best regards
Amy

Hi @Anonymous ,

 

Did you create measure using the DAX?  You may need to create it in column , EARLIER and EARLIEST are usually used in calculated column. You can go through the link to learn more: https://docs.microsoft.com/zh-cn/dax/earlier-function-dax.

 

Best Regards,

Amy

 

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

 

 

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.