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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Employee Manager Relationship - how to use PATH with monthly data

I want to use PATH() & related DAX functions (PATHITEM, PATHITEMREVERSE, etc.) however my data set from HR is expanded each month to include the latest updates (employees are added, lost, switch teams & report to new managers, etc.)

 

How can I use the PATH() function with the below type of data?

RalphKaz_0-1652452573563.png

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

FYI to everyone - I was able to solve this myself by creating 2 new columns that concatenate the Year-Month-ManagerID & Year-Month-EmployeeID and then feeding those 2 columns into the PATH statements.  Works great!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

FYI to everyone - I was able to solve this myself by creating 2 new columns that concatenate the Year-Month-ManagerID & Year-Month-EmployeeID and then feeding those 2 columns into the PATH statements.  Works great!

Whitewater100
Solution Sage
Solution Sage

Hi:

Your table can be set up like below.

Whitewater100_0-1652465326789.png

Then here are some calc columns with path measures:

Hierarchy = PATH(Employees[EmployeeID],Employees[SupervisorID])
Hiearchy CT = PATHLENGTH(PATH(Employees[EmployeeID], Employees[SupervisorID]))
Path Item #2 = PATHITEM(PATH(Employees[EmployeeID],
Employees[SupervisorID]),2,1)
Path Item #2 = PATHITEM(PATH(Employees[EmployeeID],
Employees[SupervisorID]),3,1)   etc
Then your table can look like:
Whitewater100_1-1652465487092.png

I hope this solves your question. Thanks..

 
Anonymous
Not applicable

Hi Whitewater - thanks for the reply but I know how the data "should" be setup for the PATH() function - problem is my data is structed correctly BUT it's monthly data in a single table so I need the PATH functions to only look at 1 month at a time... 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors