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
Center of Excellence

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide
Membership