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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
JeanMariePBI
Helper I
Helper I

RankX using filter within column

Hello, I am relatively new to PBI.  I'm trying to add a measured column that will rank price points from highest to lowest within each product listed in the product Column.  The "Price Ranking"is the measure that I want to achieve:  I've tried ranking using a filter and variable but my dax logic continually has errors.   Any help is appreciated.  Thanks!

 
 
Product PricePrice Ranking
A-10225.01               1
A-10151.89               2
A-10129               3
A-10121.23               4
A-10120.27               5
A-10118.06               6
A-100202.97               1
A-100154.52               2
A-10067.47               3
A-150184.09               1
A-150133.61               2

 

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@JeanMariePBI check these posts

 

very well explained and you should be able to use it in your solution.

 

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.

View solution in original post

smpa01
Community Champion
Community Champion

@JeanMariePBI  ranking in subcategory with RANKX measure

 

_maxPrice = MAX('Table 1'[Price])

_rank = 
VAR _max= MAX('Table 1'[Product])
RETURN RANKX(FILTER(ALLSELECTED('Table 1'),'Table 1'[Product]=_max),[_maxPrice],,DESC)

 

smpa01_0-1633451792597.png

 


========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

View solution in original post

4 REPLIES 4
smpa01
Community Champion
Community Champion

@JeanMariePBI  ranking in subcategory with RANKX measure

 

_maxPrice = MAX('Table 1'[Price])

_rank = 
VAR _max= MAX('Table 1'[Product])
RETURN RANKX(FILTER(ALLSELECTED('Table 1'),'Table 1'[Product]=_max),[_maxPrice],,DESC)

 

smpa01_0-1633451792597.png

 


========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

Thank you so much!  It works great.   

parry2k
Super User
Super User

@JeanMariePBI check these posts

 

very well explained and you should be able to use it in your solution.

 

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.

Works perfectly!   Thank you so much!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.