How does the PATHLENGTH function (DAX) work?
The PATHLENGTH function (DAX) returns the number of parents to the specified item in a given PATH result, including self.
PATHLENGTH Formula Syntax
How do you use the PATHLENGTH function?
You can use PathLength Function to find out the count of levels for each row. This function gets the result of Path function as the input.
Related Blog Posts
Related Support Forum Posts
Considerations when using the PATHLENGTH function
Example if the values in the PATHLENGTH column show seven levels in the hierarchy. To create the parent-child hierarchy, you must create a calculated column for each level of the hierarchy. DAX provides PATHITEM and PATHITEMREVERSE functions that return the value on a given level from the Path string. The PATHITEM function returns the item/value for a given level from the beginning of the string, whereas the PATHITEMREVERSE functions returns the item/value for a given level from the end of the string.
Related Video Tutorials
Formula examples using the PATHLENGTH function
Related Course Modules
To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.