PATHITEM Function (DAX)

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

PATHITEM(
     <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

Parent Child Hierachy
Dax Calculation question
Dax not working

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)

=PATHITEM([PCPath],1,1)

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.