PATHLENGTH DAX Function (Parent-child)
Returns returns the number of items in a particular path string. This function returns 1 for the path generated for an ID at the top/root of a hierarchy.
Syntax
Parameter | Attributes | Description |
---|---|---|
Path |
A string which contains a delimited list of IDs. |
Return values
The number of items that are parents to the specified item in a given PATH result, including the specified item.
Related articles
Learn more about PATHLENGTH in the following articles:
-
Parent-Child Hierarchies
DAX does not directly support parent-child hierarchies. To obtain a browsable hierarchy in the data model, you have to naturalize a parent-child hierarchy. DAX provides specific functions to naturalize a parent-child hierarchy using calculated columns. The complete pattern also includes measures that improve the visualization of ragged hierarchies in Power Pivot. » Read more
Related functions
Other related functions are:
Last update: Jan 11, 2021 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
MSDN documentation: https://docs.microsoft.com/en-us/dax/pathlength-function-dax