Forum Discussion

kdarnt's avatar
kdarnt
Frequent Visitor
3 years ago

Hierarchical changes over time

Hi all, I have some data that is structured roughly like the below. Basically it tracks who reported to who, stacked by month. Obviously sometimes people change managers, so it's not exactly the same from month to month. In the below, Jane and Ross both report to Brad, and Katie reports to Jane. Jane leaves in June 2020 and Katie transfers to report to Ross instead. 

 

MonthEmployee NameSupervisory Name
April 2020KatieJane
April 2020RossBrad
April 2020JaneBrad
May 2020KatieJane
May 2020RossBrad
May 2020JaneBrad
June 2020Katie Ross
June 2020RossBrad

 

When I'm only working with one month of date, I often use PATH and PATHITEM to recreate the organizational hierarchy to use in filters. But since this data is multiple months, PATH functions won't work because any one person might report to different managers over different months. 

 

Desired output - I'd like to find a way to get one output row that does the same thing as PATH, but calculated the hierarchy for only the row month. Ideally there's some clever filtering I can use with PATH and CALCULATE together so that PATH only takes into account the row month when calculating any given row. It might look like this:

 

MonthEmployee NameSupervisory NameDesired Output
April 2020KatieJaneBrad | Jane | Katie
April 2020RossBradBrad | Ross
April 2020JaneBradBrad | Jane
May 2020KatieJaneBrad | Jane | Katie
May 2020RossBradBrad | Ross
May 2020JaneBradBrad | Jane
June 2020Katie RossBrad | Ross | Katie
June 2020RossBradBrad | Ross

 

Appreciate the help!

No RepliesBe the first to reply