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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
zflory
Helper I
Helper I

RANKX 1-25

Hello

 

Very new user here with a question. I am trying to get a constant 1-25 ranking down the left hand side of this data table. That way, if I sort by either Volume or Plant Margin by Volume, the numbers 1-25 will still be in descending order down the left hand side and the accounts will change (based on Volume or Plant Margin by Volume). Can anyone assist? This is the DAX I have come up with so far

 

Rank = RANKX('Customer',[$/volume 2017],,DESC)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @zflory,

 

For your scenario, you can add a rank column to calculate the rank, then drag this to visual level filter, switch to advanced mode with 'is less than or equal to' and input 25 as filter range.

 

BTW, calculated column not works with slicer and filter, if you want to achieve the dynamic rank or effect with other filters, you need to use measure to instead.

 

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey,

I have to admit that I do not understand what you are looking for. Please prepare an Excel file with sample data, and also the expected result. Upload the file to onedrive or dropbox and share the link.

Maybe this link will also help
https://www.wiseowl.co.uk/blog/s2469/rankx-function.htm

Regards
Tom


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

The below data table is what I'm working with. I would like to have numbers 1-25 in descending order down the left side of the matrix. That way, when I sort by either Volume or Plant Margin by Volume, the numbers will stay in constant order (1-25) and I will be able to determine the top 25 customers (in order) or either of those metrics (Volume or Plant Margin by Volume). I apologize, I should have included the matrix in my original post

 

powerbi.PNG

Also, when doing my RANKX measure, is it only possible to use calculated columns in the expression argument of the measure? I am wanting to add volume from my orignnal data sheet in that argument, but Power BI is only letting me include calculated columns

 

 

Anonymous
Not applicable

Hi @zflory,

 

For your scenario, you can add a rank column to calculate the rank, then drag this to visual level filter, switch to advanced mode with 'is less than or equal to' and input 25 as filter range.

 

BTW, calculated column not works with slicer and filter, if you want to achieve the dynamic rank or effect with other filters, you need to use measure to instead.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.