Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Different relationship levels

Hello,

 

I am having a particular difficulty trying to create a relationship between 3 table. In this case, one of this tables have different levels of hierarchy in the same column.

 

1. 'factNPS'

My Net Promoter Score fact table. 

 

2. 'dimLines'

Bus lines data. Example:

LineIDBusDepotSuperintendenceetc.
1GCGES 
2GCGES 
3SAMES 
4COLES 
5RIOES 
6XPTBA 
7SSABA 
8XPTBA 

 

3 'dimManagers'

Shows me the managers of each place.

NameDepartmentIDRoleetc.
JonGCG   
KevinSAM   
Kent

COL

 

 

 

Duane

RIO

 

 

 

Mel

XPT

 

 

 

Mike

SSA

 

 

 

James

BA

 

 

 

Alex

ES

 

 

 

 

It is pretty easy to connect my 'dimLines' table to 'fatNPS', because there is a [LineID] column in 'fatNPS' table, so I am able to calculate the Net Promote Score for each Depot or Superintendence.

 

However I have no idea how to connect my 'dimManagers' to 'dimLines' and/or 'fatNPS' tables to get the NPS for each manager, since [Department] column have different levels of hierarchy.

 

PS: our managers are responsibles for several KPIs and NPS is only one of them. I also have to connect all others KPIs to each manager.

 

How could I do this?

 

Thanks for help.

  • Hi Anonymous ,

     

    1. There is no relationship between dim Managers and dim Lines.

     

     

    2. Then we can create two column in dim Lines to calculate the managers’ name.

     

    Column = CALCULATE(MAX(dimManagers[Name]),FILTER(dimManagers,dimManagers[Department]=dimLines[BusDepot]))

     

    Column 2 = CALCULATE(MAX(dimManagers[Name]),FILTER(dimManagers,dimManagers[Department]=dimLines[Superintendence]))

     

     

    And we create a matrix, the result like this,

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared.

    BTW, pbix as attached.       

     

    Best regards,

     

    Community Support Team _ zhenbw

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

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Well, you could create 2 relationships and use USERELATIONSHIP. Otherwise, you will likely have to form the "relationship" within any measure you create.

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi Anonymous ,

     

    1. There is no relationship between dim Managers and dim Lines.

     

     

    2. Then we can create two column in dim Lines to calculate the managers’ name.

     

    Column = CALCULATE(MAX(dimManagers[Name]),FILTER(dimManagers,dimManagers[Department]=dimLines[BusDepot]))

     

    Column 2 = CALCULATE(MAX(dimManagers[Name]),FILTER(dimManagers,dimManagers[Department]=dimLines[Superintendence]))

     

     

    And we create a matrix, the result like this,

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared.

    BTW, pbix as attached.       

     

    Best regards,

     

    Community Support Team _ zhenbw

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