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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Need Help with ranking within a group power bi

 I am trying to rank lanes within each equipment type based on amount charged. The result I am trying to see is ranks as 1,2,3  etc for each lane within various equipment types.

 

Can anyone help with this

 

 

2020-03-01 08-58-47_All_Expedite_Spot Dashboard - Power BI Desktop.jpg 

 

 
 

 

 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

You can create one measure as below if your expected result is same with the one in below screenshot:

Ranking = RANKX(ALL('Equipment'[LANES]),CALCULATE(SUM('Equipment'[AMOUNT_CHARGED])),,DESC)

Ranking.JPGBest Regards

Rena

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous,

You can create one measure as below if your expected result is same with the one in below screenshot:

Ranking = RANKX(ALL('Equipment'[LANES]),CALCULATE(SUM('Equipment'[AMOUNT_CHARGED])),,DESC)

Ranking.JPGBest Regards

Rena

Greg_Deckler
Community Champion
Community Champion

It would be very helpful to know the formula for [tot] measure as this could explain any weirdness you are seeing. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

 

tot = sum([AMOUNT_CHARGED])

JarroVGIT
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

Please have a look at my blog about ranking:

https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-Columns/ba-p/918655

 

If you want more advanced ranking in your visual, I usually create more advanced measures like this:

RankMeasureInSpecificVisual =
VAR _tmpTable = SUMMARIZE(Table, Column1, Column2, "totColumn", [tot])
VAR _rankedTable = ADDCOLUMNS(_tmpTable, "Rank", RANKX(_tmpTable, [totColumn]))
RETURN
MAXX(FILTER(_rankedTable, [Column1] = SELECTEDVALUE(Table[Column1]) && [Column2] = SELECTEDVALUE(Table[Column2])), [Rank])

Let me know if this works for you 🙂

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @JarroVGIT 

 

I took a look at your solution and looks like the values under Name column in distinct in that case. Do you know if we can rank the values when we have different values in the second column for the same value in first column.

amitchandak
Super User
Super User

I think you do not need the third parameter. This best explained in articles given below.

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

somehow it doesn't work...I tried the first link which explains ranking by subcategory but when i try to use equipment type field in earlier function it get greyed out throwing an error.

 

 

 

 

 

2020-03-02 08-33-58_All_Expedite_Spot Dashboard - Power BI Desktop.jpg

The one trying out should be created as a column, not as a measure. Those which has aggerated field are the one need to created as a measure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors