• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Data Stories
    • Power BI Stories
    • 1 dataset, 100 matplotlib visualizations
  • Learning Portal
    • Download Center
    • 25 Days Challenge
    • DAX Glossary
    • Power BI
    • Power BI by Topic
    • Python
    • 1 dataset, 100 matplotlib visualizations
  • Courses
    • Power BI Mini Master Class 1: Using a REST API as a data source
    • Power BI Master Class 1: COVID Tracker
    • Introduction to Power BI – FREE Online course
    • M Language + Power Query Course Bundle
    • Power Query Online Training [updated 2022]
    • M Language Online Course: The unofficial and Practical Reference Guide [updated 2025]
    • My Courses
  • Shop
    • Courses
    • Master Classes
    • Template Apps
    • JSON Themes
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Search
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / PATHLENGTH

PATHLENGTH

posted on August 31, 2017

« Back to Glossary Index

Syntax

PATHLENGTH(<path>)

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.



Table of contents:

01:51 PATH

06:37 PATHLENGTH

07:31 PATHITEM

08:30 PATHITEMREVERSE

09:56 PATHCONTAINS



Watch the tutorial:

DAX Fridays! #20: Parent and Child Functions -Hierarchies

Links to the mentioned resources

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #20



Remarks

  • The delimiter used to separate the ascendants is the vertical bar, ‘|’.
  • The values in ID_columnName and parent_columnName must have the same data type, text or integer.
  • Values in parent_columnName must be present in ID_columnName. That is, you cannot look up a parent if there is no value at the child level.
  • If parent_columnName is BLANK then PATH() returns ID_columnName value. In other words, if you look for the manager of an employee but the parent_columnName column has no data, the PATH function returns just the employee ID.
  • If ID_columnName has duplicates and parent_columnName is the same for those duplicates then PATH() returns the common parent_columnName value; however, if parent_columnName value is different for those duplicates then PATH() returns an error. In other words, if you have two listings for the same employee ID and they have the same manager ID, the PATH function returns the ID for that manager. However, if there are two identical employee IDs that have different manager IDs, the PATH function returns an error.
  • If ID_columnName is BLANK then PATH() returns BLANK.
  • If ID_columnName contains a vertical bar ‘|’ then PATH() returns an error.

This DAX function is not supported for use in DirectQuery mode.

Was this helpful?
See Also:
  • PATH
  • PATHCONTAINS
  • PATHITEM
  • PATHITEMREVERSE
« Back to Index

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer CTA

Join our community of +50,000 professionals

Become a Member

Subscribe to YouTube

About me:

Curbal AB
Badhusgatan 7B
722 15 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2025 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In