Returns the item at the specified position from a string resulting from evaluation of a PATH function.
Positions are counted backwards from the right to the left.
PATHITEMREVERSE (<path>, <position>, [<type>])
|Sr.No.||Parameter & Description|
A text string in the form of the results of a PATH function.
An integer expression with the position of the item to be returned.
Position is counted backwards from the right to the left.
An enumeration that defines the data type of the result.
TEXT or 0: Results are returned with the data type text. (If omitted, this is default).
INTEGER or 1: Results are returned as integers.
The nth position ascendant in the given path, counting from the current to the oldest.
DAX PATHITEMREVERSE function can be used to get an individual item from a hierarchy resulting from a PATH function.
This function reverses the standard order of the hierarchy, so that the closest items are listed first. For example, if the PATH function returns a list of managers above an employee in a hierarchy, the PATHITEMREVERSE function returns the employee’s immediate manager in position 2 as position 1 contains the employee’s ID.
If the number specified for position is less than one (1) or greater than the number of elements in path, the PATHITEMREVERSE function returns BLANK.
If the type is not a valid enumeration element, an error is returned.
= PATHITEMREVERSE(PATH(Employee[EmployeeID], Employee[ManagerEmployeeID]), 2)
Returns the immediate managers of each employee.
26 Lectures 4.5 hours