PATHITEM DAX function in Power BI
The PATHITEM DAX function returns the item at the specified position from a string resulting from evaluation of a PATH function. Positions are counted from left to right.
Syntax PATHITEM(path, position[, type])
The function has the following parameters:
- path: A text string in the form of the results of a PATH function.
- position: An integer expression with the position of the item to be returned.
- type: It is an optional parameter. It is an enumeration that defines the data type of the result:
- TEXT: 0 Results are returned with the data type text. (default).
- INTEGER: 1 Results are returned as integers.
Return value: 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.
Example: The following example returns the third-tier manager of the current employee.
DAX
PATHITEM Column = PATHITEM( Employees[HierarchyPath], 3, INTEGER )
The output of the above code is shown below:
