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

PATHLENGTH ( <Path> )
Parameter Attributes Description
Path

A string which contains a delimited list of IDs.

Return values

Scalar A single integer value.

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: Oct 13, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/pathlength-function-dax

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of PATHLENGTH? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.