Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I need to perform Rank function. I believe it not works when we take multiple tables into consideration.
Please consider the following scenario:
I have a table 1 as below:
Countries |
US |
UK |
HK |
SG |
MY |
Table 2:
Countries | Values |
United States | 10 |
United States | 30 |
United Kingdom | 5 |
Singapore | 10 |
The expected table should be as below:
Countries | Values | Rank |
US | 40 | 1 |
SG | 10 | 2 |
UK | 5 | 3 |
For US, we will be summing Value column from Table 2 where Countries = United States. Similarly SG = Singapore, UK = United Kingdom. I got the Values column, but couldnt find a DAX formula to calculate RANK.
Solved! Go to Solution.
I feel like I am missing something but the standard RANKX did not yield the expected result. Here's my version of the measure:
Looking forward to see how it should actually be done.
Hi,
In the first table aren't you missing a crucial column - name of the Country? Once that is there, you can create a relationship from Table2 to Table1. Drag Country from Table1 to your visual and the standard RANKX() function should work.
I feel like I am missing something but the standard RANKX did not yield the expected result. Here's my version of the measure:
Looking forward to see how it should actually be done.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |