In DAX Studio I'm evaluation the next code:
EVALUATE
ADDCOLUMNS (
'Parent Child',
"Path",PATH('Parent Child'[EmployeeKey],'Parent Child'[ParentEmployeeKey]),
"Path Length", PATHLENGTH(PATH('Parent Child'[EmployeeKey],'Parent Child'[ParentEmployeeKey])),
"Path Item", PATHITEM(PATH('Parent Child'[EmployeeKey],'Parent Child'[ParentEmployeeKey]), 3)
)
I'm getting the right result. However, I wonder if I can implement something like this:
DEFINE
VAR p = PATH('Parent Child'[EmployeeKey],'Parent Child'[ParentEmployeeKey])
EVALUATE
ADDCOLUMNS (
'Parent Child',
"Path",p,
"Path Length", PATHLENGTH(p),
"Path Item", PATHITEM(p, 3)
)
I've tried some answers provided on different forums, but so far I'm not getting any possible solution.
Regards,