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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
IPGeorgiev
Helper III
Helper III

RankX - questions - Rank based on measure from another table

Hi All,

 

I would like to ask for some help and will really appreciate it!

 

Basically I have one table(Table 1) which has the following columns

 

  • employee names
  • Supervisor name

 

I have another table (Table 2) which has raw data for each employee and the following columns:

 

  • Employee name
  • Date
  • Type of contact
  • Program sub groups
  • Positive reponeses
  • Negative responses

 

I have table 3  which has

 

  • Program sub groups
  • Program goups ( basically few sub groups will have the same group and for exmaple 10 sub groups will form only 2 groups)

 

Out of table 2 I have added a measure to show the % of positive reponses – Positive% = Positive responses/(positive reponses+negative responses)

 

Then I create a pivot which will have as rows  Supervisor name and as a value the Postive%

 

Now I want to add a second column (under values) which will rank those supervisors based on the postive% - the highest should get RANK 1 etc.

 

I will also want to filter the matrix to include only specific groups. 

 

Do you have any ideas how to achieve this?

 

Many thanks in advance!

3 REPLIES 3
IPGeorgiev
Helper III
Helper III

Any ideas anyone? 

Greg_Deckler
Super User
Super User

@IPGeorgiev Check out https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452

 

Otherwise not really enough to go on. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

I will try to simplify it, thanks for your time!

 

Table 1

 

Employee NameDateTypePositive responsesNegative responses
agent17/22/2021Billing15
agent17/22/2021Payment20
agent17/22/2021Charge50
agent27/22/2021Billing41
agent27/22/2021Payment60
agent27/22/2021Charge21
agent37/22/2021Billing42
agent37/22/2021Payment10
agent37/22/2021Charge103
agent47/22/2021Billing41
agent47/22/2021Payment20
agent47/22/2021Charge60
agent57/22/2021Billing30
agent57/22/2021Payment53
agent57/22/2021Charge22
agent67/22/2021Billing81
agent67/22/2021Payment60
agent67/22/2021Charge70
agent77/22/2021Billing40
agent77/22/2021Payment61
agent77/22/2021Charge21
agent87/22/2021Billing41
agent87/22/2021Payment71
agent87/22/2021Charge82
agent97/22/2021Billing30
agent97/22/2021Payment51
agent97/22/2021Charge70
agent107/22/2021Billing90
agent107/22/2021Payment50
agent107/22/2021Charge41

 

Table 2

 

Employee NameSupervisorName
agent1Supervisor1
agent2Supervisor2
agent3Supervisor3
agent4Supervisor1
agent5Supervisor2
agent6Supervisor3
agent7Supervisor1
agent8Supervisor2
agent9Supervisor3
agent10Supervisor1

 

There is a relationship between those two tables on EmployeeName level - Many to One

 

There is a measure in Table 1 :

 

Positive% = SUM(Table1[Positive responses]/(Table1[Postive responses]+Table1[Negative respnonses])

 

The final output should look like this:

 

Row LabelsSum of Positive responsesSum of Negative responses Positive%Rank
Supervisor15090.8474576272
Supervisor241110.7884615383
Supervisor35170.879310345

1

 

Ranking here is with the following logic -the higher the Postive% the better - so the Supervisor whose team has the highest Postivie% should be first. 

 

Many thanks in advance!

 

Best regards,

Ivan

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors