Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Org Shaping Logic

Hi Folks,   A little stumped here. My company has a document that shows reporting relationships up to 6 layers. What I want to do is to create some of these layers as drop down filters and to show ...
  • freder1ck's avatar
    8 years ago

    First of all, how can Gorilla Magilla have George Jetson and Rainbow Brite both as managers?

     

    There was a great post on this today at PowerPivotPro.com, so I applied it using your situation.

     

    You can generate an org chart if you have each employee's manager. 

    The data should look something like this:

     

    EmployeeManager

    Col BluegrassJack Bauer
    Jack BauerMagilla Gorilla
    Magilla GorillaRainbow Brite
    Rainbow BriteMatt Tracker
    Iam MumraMagilla Gorilla
    Matt Tracker
    FluttershyMatt Tracker
    WhistleFluttershy

    Then, you'll add calculated columns to the table.

     

    The first column does error handling for the top manager: 

    [New Manager] =
    VAR CurrentEmployee = People[Manager]
    RETURN

    IF (
    COUNTROWS (
    FILTER ( People, People[Employee] = CurrentEmployee )
    )
    = 0,
    People[Employee],
    People[Manager]
    )

     

    [Manager Path]

    =
    PATH (
    People[Employee],
    People[New Manager] )

     

    [Level 1] =
    LOOKUPVALUE (
    People[Employee],
    People[Employee], PATHITEM ( People[Manager Path], 1 )
    )

     

    [Level 2] =
    LOOKUPVALUE (
    People[Employee],
    People[Employee], PATHITEM ( People[Manager Path], 2 )
    )

     

    [Level x] =
    LOOKUPVALUE (
    People[Employee],
    People[Employee], PATHITEM ( People[Manager Path], x )
    )

     

    The P3 article: 

    https://powerpivotpro.com/2017/12/imagine-people-tables/

     

    Yours,

    Fred