Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Rankx for different tables

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:

CountriesValues
United States10
United States30
United Kingdom5
Singapore10

 

The expected table should be as below: 

 

CountriesValuesRank
US401
SG102
UK53

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.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

I feel like I am missing something but the standard RANKX did not yield the expected result.  Here's my version of the measure:

 

lbendlin_0-1686960097278.png

 

 

Looking forward to see how it should actually be done.

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

I feel like I am missing something but the standard RANKX did not yield the expected result.  Here's my version of the measure:

 

lbendlin_0-1686960097278.png

 

 

Looking forward to see how it should actually be done.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.