Forum Discussion
Dunner2020
5 years agoPost Prodigy
Rankx based on table column
Hi there,
I have data which looks like the following:
| ID | No of Customer |
| AX168 | 1081 |
| FH5308 | 1046 |
| CH2008 | 551 |
| FK7784 | 1336 |
| WK2752 | 1456 |
| QT5202 | 390 |
| AT7642 | 525 |
| AB4 | 543 |
| AT7692 | 347 |
| WK2755 | 620 |
| AX162 | 607 |
| CM822 | 725 |
| PC3 | 500 |
| EK480 | 461 |
| OT2 | 305 |
| ET5 | 635 |
| CH2006 | 842 |
| LF6576 | 198 |
| MG6 | 443 |
Now I want to create a measure which ranks based on the number of customers column. I wrote a code something like that:
Rank by Customer = RankX(ALL(Table),Table['No of Customer'],,DESC)
I know that Table['No of Customer'] is the wrong argument and it should be replaced by expression. However, did not know what the replacement should be? Could anyone help me in that?
4 Replies
- Greg_DecklerCommunity Champion
- Dunner2020Post Prodigy
Greg_Deckler , I followed the article and changed my code to the following:
ICP Rank = RANKX( ALL('Table'),[ICP],,DESC)But it still gave me an error that 'The value for ICP cannot be determined. Either the column does not exist, or there is no current row for this column'.- Greg_DecklerCommunity Champion
Dunner2020 - You need an aggregator around it like SUM, MAX, etc.