Forum Discussion
enzo88
3 years agoFrequent Visitor
RANKX by multiple group
HI
i have this table:
| Material | tot value € | sub-category | Vendor |
| a | 100 | CM1 | x |
| a | 10 | CM2 | x |
| b | 20 | CM2 | g |
| b | 200 | CM3 | y |
| c | 30 | CM1 | r |
| c | 300 | CM3 | z |
i would like to create a measure that dynamically calculate the ranking of each material by total value, but still considering the split by vendor and sub-category so that it would result like this:
| Material | tot value € | sub-category | Vendor | Rank Measure |
| a | 100 | CM1 | x | 1 |
| a | 10 | CM2 | x | 2 |
| b | 20 | CM2 | g | 2 |
| b | 200 | CM3 | y | 1 |
| c | 30 | CM1 | r | 2 |
| c | 300 | CM3 | z | 1 |
I have tried this:
Rank Measure =
RANKX(allselected('PO Schedule'[Material]),[tot value €],,DESC)
and i obtain
| Material | tot value € | sub-category | Vendor | Rank Measure |
| a | 100 | CM1 | x | 1 |
| a | 10 | CM2 | x | 1 |
| b | 20 | CM2 | g | 1 |
| b | 200 | CM3 | y | 1 |
| c | 30 | CM1 | r | 1 |
| c | 300 | CM3 | z | 1 |
Thanks
Enzo