DAX Function Guide

PATHITEMREVERSE
Empty image or helper icon

Sam McKay

CEO & Founder

How does the PATHITEMREVERSE work?
The PATHITEMREVERSE function (DAX) returns the item at the specified position from a string resulting from evaluation of a PATH function. Positions are counted backwards from right to left.
PATHITEMREVERSE Formula Syntax

PATHITEMREVERSE(
     <path>, <position[, <type>]
)

How do you use the PATHITEMREVERSE?
  • This 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 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 because position 1 contains the employee’s id.
Related Blog Posts

Loading

Considerations when using the PATHITEMREVERSE?
  • If the number specified for position 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.
Related Video Tutorials

Loading

Formula examples using the PATHITEMREVERSE

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

= PATHITEMREVERSE(PATH(Employee[EmployeeID], Employee[ManagerEmployeeID]), 2)

= PATHITEMREVERSE(‘ParentChild'[cPath],3,INTEGER)

Related Courses

Loading