Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

How to use RANKX across multiple tables

Hello! 

 

I have 4 tables full of user data connected by a user table called Headcount. It connects by several foreign keys to the four different tables where I'm already using rankx to calculate ranks and scores to rank them on. Below is an example of the tables for reference: 

 

Headcount

Agent1AgentIDADID
Fred2321315FFED1
Chuck5555432CHUCKY1
Larry3333333LARRY9
Paul2212345PAUL89

 

`Headcount`[ADID] > `QA`[AgentID] 

1) QA

Agent1AgentIDEval Score %
FredFreddy65%
ChuckChucky185%
LarryLarry90%
PaulPaully75%

 

`Headcount`[Agent1] > `Surveys`[Agent1]

 

2) Surveys

Agent1AgentIDScore
FredFreddy65%
ChuckChucky185%
LarryLarry90%
PaulPaully75%

 

`Headcount`[Agent1] > `ADH`[Agent1]

 

3) ADH

Agent1AgentIDADH %
FredFreddy65%
ChuckChucky185%
LarryLarry90%
PaulPaully75%

 

`Headcount`[Agent1] > `AHT`[AHT %]

 

4) AHT

Agent1AgentIDAHT %
FredFreddy65%
ChuckChucky185%
LarryLarry90%
PaulPaully75%

 

I'm performing multiple ranks across all these tables that all tie back to the headcount table. How do I build the dax in a way that will still utilize my relationships in my datamodel without referring to the individual user identifying field in each table? Below is one of my current rank formulas for reference.

 

QA Rank =
RANKX(
    ALL(QA[Agent1]),
    QA[Eval Score %],,
    DESC,
    Skip
)
 
Also, is there a way I could add a filter to these rank calculations to only rank based on other columns from the Headcount report? 
 
Thank you! 
No Replies