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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
erenonem
Frequent Visitor

How to create Rankx mesaure using 1 measure and more than 1 table?

Hi,

 

I have 3 different master tables linked with some fact tables. All I want to create a Rankx measure, and rank those master tables fields by a specific measure.

 

My Sales measure works for 3 different fields and shows the results. If I create 3 different Rankx measure for each of those fields, its also working. 

 

They are different table and I m not able to use RANKX(<table>, <expression>, <value>, <order>, <ties>) function.

 

Any chance to get some help?

 

Table 1: Gender

Table 2: Age Group

Table 3: Region

 

Common Measure is Sales and working perfectly for 3 of them

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

HI @erenonem ,

Pls refer the below:

base table:

vluwangmsft_0-1664187042661.pngvluwangmsft_1-1664187055820.png

vluwangmsft_2-1664187063246.png

 

Result:

vluwangmsft_3-1664187077847.png

You could download my pbix file to learn detail operations.

 

 

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

HI @erenonem ,

Pls refer the below:

base table:

vluwangmsft_0-1664187042661.pngvluwangmsft_1-1664187055820.png

vluwangmsft_2-1664187063246.png

 

Result:

vluwangmsft_3-1664187077847.png

You could download my pbix file to learn detail operations.

 

 

 

Best Regards

Lucien

HoangHugo
Solution Specialist
Solution Specialist

Hi

Create a table expression to combine your 3 table (they should same number of columns and column names), then rank it. Try this one

rank =
var table = UNION (table 1, table 2, table 3)
return RANKX([table],value)

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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