Forum Discussion
Dynamically rank calculated measure based on different groupings
Hi All,
I'm having some trouble getting my rank to work properly and was hoping for some assistance. As you can see below, my Industry Per Caps Rank column is not what you would expect. I'd like the per caps rank for product A to be 1, product B to be 2, and so on. My formula is below as well. Does anyone know what I may be doing wrong here? I also want the ranking to update dynamically based on the slicer I'm using (e.g., instead of product, rank by manufacturer, etc). Any help would be greatly appreciated!!
| Product | Industry Per Caps | Industry Per Caps Rank |
| A | 2.55 | 2 |
| B | 1.86 | 5 |
| C | 1.68 | 7 |
| D | 1.62 | 7 |
| E | 1.55 | 7 |
| F | 1.54 | 7 |
| G | 1.19 | 11 |
| H | 0.77 | 16 |
| I | 0.58 | 17 |
| J | 0.48 | 19 |
| K | 0.46 | 19 |
| L | 0.4 | 21 |
| M | 0.26 | 28 |
| N | 0.07 | 82 |
Hi,
Please check
PBI File : https://easyupload.io/fxanxw
17 Replies
- SachinNandanwar
Impactful Individual
DynamicRank = RANKX ( ALLSELECTED ( 'product_industry_per_caps' ), CALCULATE ( MAX ( 'product_industry_per_caps'[Product] ) ), , ASC, DENSE )- AnonymousNot applicable
Hi Sachin!
Thanks so much for your quick response. Would there be a way to build the formula to be able to swap out [product] column for other columns? For example, let's say I want to see per caps figures by [region] instead of [product]. Is this possible? I appreciate your insight!
- SachinNandanwar
Impactful Individual
Yes..
DynamicRank = RANKX ( ALLSELECTED ( 'product_industry_per_caps' ), CALCULATE ( MAX ( 'product_industry_per_caps'[Region] ) ), , ASC, DENSE )