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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help with RANKX and column from related table

Look below for a picture showing the values in two tables (Survey on the left, National Rank on the right). The relationship is the "Standard" column but not all survey standards have national ranks. In this case, there are only five standards with national ranks.

 

I added two measures:

Observation Count (how many times a Standard value appears in the Survey table). ABC appears 3 times in the Survey table.

Rank of Standard (used RANKX to calculate the rank based on the Observation Count). ABC has the most with 3, so it is ranked 1.

 

When I add a table visualization and display data only from the Survey table, the list appears correctly. (Middle image). Note that I have a filter to display only rows where "Rank of Standard" is less than 4.

 

But when I add the National Rank in the bottom table, the visual displays ABC five times with a rank of 1 through 5. Obviously this isn't what I want to display. I just want the relationship to find ABC in the National Rank table, display ABC once, and display "5" in the National Rank column. BCD should show 4, and DEF should show 2.

 

Is there a way to make this work?

Thanks!

 

rankx problem

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

The easiest way to solve this issue is changing the "Cross filter direction" of the relationship to "both" and setting the aggregation of the [National Rank] to "maximum" or "minimum". Please refer to the snapshot below.

Help-with-RANKX-and-column-from-related-table

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

The easiest way to solve this issue is changing the "Cross filter direction" of the relationship to "both" and setting the aggregation of the [National Rank] to "maximum" or "minimum". Please refer to the snapshot below.

Help-with-RANKX-and-column-from-related-table

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.