PATHITEM

Updated on

PATHITEM is a DAX function that returns the nth item in a delimited path string generated by the PATH function.

Syntax

PATHITEM(
   Path,
   Position,
   Type
)
Argument Properties Description
Path A string which contains a delimited list of IDs.
Position An integer denoting the position from the left end of the path.
Type Optional Optional. If missing or 0 then this function returns a string. If 1 then this function returns an integer.

Return Values

The identifier returned by the PATH function at the specified position in the list of identifiers. Items returned by the PATH function are ordered by most distant to current.

Remarks

  • 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.

  • 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 function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following example returns the third tier manager of the current employee; it takes the employee and manager IDs as the input to a PATH function that returns a string with the hierarchy of parents to current employee. From that string PATHITEM returns the third entry as an integer.

= PATHITEM(PATH(Employee[EmployeeKey], Employee[ParentEmployeeKey]), 3, 1)

Other functions related to PATHITEM are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/pathitem-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy