How does the PATHITEM function (DAX) work?
The PATHITEM function (DAX) returns the item at the specified position from a string resulting from evaluation of a PATH function. Positions are counted from left to right.
PATHITEM Formula Syntax
<path>, <position>[, <type>]
How do you use the PATHITEM function?
This function can be used to return a specific level from a hierarchy returned by a PATH function. For example, you could return just the skip-level managers for all employees.
Related Blog Posts
Related Support Forum Posts
Considerations when using the PATHITEM function
- If you specify a number for position that is less than one (1) or greater than the number of elements in path, the PATHITEM function returns BLANK
- If type is not a valid enumeration element an error is returned.
- This DAX function is not supported for use in DirectQuery mode.
Related Video Tutorials
Formula examples using the PATHITEM function
=PATHITEM(PATH(Employee[EmployeeKey], Employee[ParentEmployeeKey]), 3, 1)
= PATHITEM(PATH(Employee[EmployeeID], Employee[ManagerEmployeeID]), Employee[P ath Length]-2)