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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kleetus51
Frequent Visitor

Rank Customers by Sales

I'm trying to do a simple ranking by sales and customer, but can't seem to get it nailed down. How do I get the rank coloumn in DAX?

Account Sales Rank
ATW $20,933 27
BJZ $40,120 18
BZR $78,734 7
CKG $80,690 5
CRH $28,906 22
DOR $56,813 14
DTR $99,011 1
DZL $34,011 20
EQE $74,664 11
HMI $80,421 6
HSB $91,677 3
ILF $65,282 13
IRS $94,869 2
KIJ $50,268 17
LAD $22,451 24
LDW $21,372 26
MVV $85,198 4
OHQ $75,676 10
PPW $67,460 12
PXM $78,262 8
RCE $29,641 21
TLH $77,300 9
UCD $39,843 19
UCE $21,766 25
UEY $19,824 29
VMH $20,726 28
WGB $52,976 16
WGN $56,574 15
ZHL $27,136 23
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@kleetus51 if you want to work with Power BI you need to understand the difference between this very basic concept. Anyhow add a rank measure and this will do it:

 

Rank  = RANKX ( ALLSELECTED ( 'Table'[Account] ), [Sales Measure], ,DESC )

 

 



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

5 REPLIES 5
parry2k
Super User
Super User

@kleetus51 if you want to work with Power BI you need to understand the difference between this very basic concept. Anyhow add a rank measure and this will do it:

 

Rank  = RANKX ( ALLSELECTED ( 'Table'[Account] ), [Sales Measure], ,DESC )

 

 



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.

parry2k
Super User
Super User

@kleetus51 why do you want rank to be a column, not a measure?



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.

I don't care if rank is a column or measure. As long as I can get it to display properly regardless of how the table is sorted it doesn't matter to me. I just want the rank value.

parry2k
Super User
Super User

@kleetus51 sales is a customer or a measure?



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.

Sales is a measure

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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