Forum Discussion
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 |
Anonymous 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 )
5 Replies
- parry2kSuper User
Anonymous 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 ) - parry2kSuper User
Anonymous sales is a customer or a measure?
- AnonymousNot applicable
Sales is a measure
- parry2kSuper User
Anonymous why do you want rank to be a column, not a measure?
- AnonymousNot applicable
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.