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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Boycie92
Resolver I
Resolver I

RANKX Help

Hi

 

I was wondering if someone could help me.

 

I want to create a measure that will work based on the following conditions:

 

I want it to show the top 4 Highest Performers and filter out everyone else. However I also want it to include a Unique Person in the Ranking. This person no matter what their score is will always be ranked as Number 4 unless they are ranked higher.

 

For Example

 

Department A:

 

Name           Rank    Score

Joe               1            9

Jen               2            5

Ben              3            4

Unique ID    4            2

 

OR

 

Department A:

 

Name           Rank    Score

Joe               1           10

Unique ID    2            7

Ben              3            4

Jen               4            1

 

I have the following columns:

 

Department 

Name

Score

 

Thanks in advance for the help.

1 ACCEPTED SOLUTION

@Boycie92

 

Since you always want to include that specific person in "the four", you need to exclude that person in the dataset and rank the top 3 first, then UNION that person together. 

 

Regards,

View solution in original post

3 REPLIES 3
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Boycie92

 

According to your description, you actually want to filter out top 3 performer and 1 specific Person, RANK all 4 people. Right?

 

In this scenario, you can use TOPN() function to create a calculated table with the 3 best performers. Then use "Union Query" in Query Editor to combine a dataset with that specific person record only. Now you can create a calculated column to RANK all 4 people.

 

Regards,

Hi @v-sihou-msft,

 

Thanks for your response.

 

I already have the specific person within the data set. Do I still need to follow the process you recommended or can I just use the TOPN() function?

 

Thanks,                                                                                                                                                                                      

@Boycie92

 

Since you always want to include that specific person in "the four", you need to exclude that person in the dataset and rank the top 3 first, then UNION that person together. 

 

Regards,

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors