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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MitSom_1
Regular Visitor

RANKX for table visual with fields from multiple source tables

Hi all, this may sound really simple but I have been struggling with it.

 

I want add a rank measure in my table to give the rank of SupplierCode using the Points field, like this:

MitSom_1_0-1706005924350.png

But then I also want to add in an Area field that comes from a different source table, but when I do this, it messes up the ranking (I want it to ignore the Area for the ranking, but just rank Supplier code):

MitSom_1_1-1706006062173.png

Any idea what DAX code I need to use to get this? Any help would be very much appreciated.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MitSom_1 ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:
Table1:

vheqmsft_0-1706063062599.png

Table2:

vheqmsft_1-1706063078872.png

Relationship:

vheqmsft_2-1706063126929.png

1.Create a new table which add table 1 followed by table 2's AREA column

Table =
ADDCOLUMNS (
    table1,
    "Area", LOOKUPVALUE ( table2[Area], table2[SupplierCode], table1[SupplierCode] )
)

2.Rank by Points column(Create a new column)

Rank = RANKX(ALL('Table'), 'Table'[Points])

3.Final output

vheqmsft_3-1706063322689.png

 

Best regards

Albert He

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @MitSom_1 ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:
Table1:

vheqmsft_0-1706063062599.png

Table2:

vheqmsft_1-1706063078872.png

Relationship:

vheqmsft_2-1706063126929.png

1.Create a new table which add table 1 followed by table 2's AREA column

Table =
ADDCOLUMNS (
    table1,
    "Area", LOOKUPVALUE ( table2[Area], table2[SupplierCode], table1[SupplierCode] )
)

2.Rank by Points column(Create a new column)

Rank = RANKX(ALL('Table'), 'Table'[Points])

3.Final output

vheqmsft_3-1706063322689.png

 

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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