Syntax
PATHITEMREVERSE(<path>, <position>[, <type>])
Tutorial with example
In this video we will go through how to work with hierarchies using the following DAX functions: PATH, PATHLENGTH, PATHITEM, PATHITEMREVERSE, PATHCONTAINS
The example used will be a simplified bill of materials (BOM) but in the microsoft documentation, there is an excellent example for employees and Managers.
Keynotes:
01:51 PATH
06:37 PATHLENGTH
07:31 PATHITEM
08:30 PATHITEMREVERSE
09:56 PATHCONTAINS
Download example file:
Link to demo file here.
Remarks
- 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.
- 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.
This DAX function is not supported for use in DirectQuery mode.
[Total: 1 Average: 5/5]
« Back to Index
Let us know your thoughts...