MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Parent-Child Hierarchies0%
Study MaterialsCheatsheet
Power BI for AdvancedProgress 0%
1.1Quick recap of DAX, Modeling, and RLS1.2Enterprise requirements in Power BI
2.1Context Transition in DAX2.2Advanced Time Intelligence2.3Parent-Child Hierarchies
HomeTutorialsPower BI for AdvancedParent-Child Hierarchies
Row-Level Security (Advanced)

Parent-Child Hierarchies

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

In organizational management, employee reporting structures, and general ledger chart of accounts, data is frequently organized in Parent-Child Hierarchies:

  • An employee reports to a Manager.
  • That Manager reports to a Director.
  • The Director reports to a Vice President.
  • The Vice President reports to the CEO.

Unlike fixed-depth product hierarchies (Category → SubCategory → Product), parent-child hierarchies have uneven and variable depth (one branch may have 3 levels, while another has 7 levels).


1. The DAX PATH Functions

DAX provides specialized functions to unravel recursive parent-child structures into linear, navigable dimensions:

FunctionPurposeSyntax
PATHGenerates a delimited text string tracing the lineage from top root to current node.PATH(IDColumn, ParentIDColumn)
PATHLENGTHReturns the depth (level count) of the current node in the hierarchy tree.PATHLENGTH(PathColumn)
PATHITEMExtracts the specific ancestor ID at a designated level of the path.PATHITEM(PathColumn, Position, [Type])
PATHCONTAINSChecks whether a specific ancestor ID exists anywhere within the path (ideal for security!).PATHCONTAINS(PathColumn, ManagerID)

2. Step-by-Step Parent-Child Flattening

Consider Dim_Employee with EmployeeID and ManagerID:

1EmployeeID | EmployeeName | ManagerID
2---------------------------------------
31 | Satya (CEO) | BLANK
42 | Scott (EVP) | 1
53 | Julia (CVP) | 2
64 | Aarav (Eng) | 3

Step 1: Create the Hierarchy Path Column

1EmployeePath = PATH(Dim_Employee[EmployeeID], Dim_Employee[ManagerID])
2-- Result for Aarav: "1|2|3|4"

Step 2: Extract Leveled Hierarchy Columns

1Level_1_Executive =
2LOOKUPVALUE(
3 Dim_Employee[EmployeeName],
4 Dim_Employee[EmployeeID],
5 PATHITEM(Dim_Employee[EmployeePath], 1, INTEGER)
6)
7 
8Level_2_VP =
9LOOKUPVALUE(
10 Dim_Employee[EmployeeName],
11 Dim_Employee[EmployeeID],
12 PATHITEM(Dim_Employee[EmployeePath], 2, INTEGER)
13)
14 
15Level_3_Director =
16LOOKUPVALUE(
17 Dim_Employee[EmployeeName],
18 Dim_Employee[EmployeeID],
19 PATHITEM(Dim_Employee[EmployeePath], 3, INTEGER)
20)

Now you can drag Level_1_Executive, Level_2_VP, and Level_3_Director into a standard Matrix visual to render a clean, drillable organizational tree!


Interactive Quiz• Knowledge Check

Multiple Choice Questions

Question 1
What DAX function converts a recursive Parent-Child relationship (e.g., EmployeeID and ManagerID) into a delimited string tracing the full lineage path?
Question 2
What delimiter does the DAX PATH function use internally to separate ancestor IDs?
Question 3
How do you determine the depth level of an employee in an organizational hierarchy tree?
Question 4
Which function checks whether a specific manager exists anywhere in an employee's management chain for organizational Row-Level Security?
Question 5
Why is flattening parent-child hierarchies into discrete columns (Level 1, Level 2, Level 3) necessary for Power BI visuals?

Next Lesson

Row-Level Security (Advanced)

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Advanced Time IntelligenceRow-Level Security (Advanced)

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

12-Month Data Analysis Mastery Program

Master Full-Stack Data Analytics (Excel, SQL, Python, Power BI & Tableau)

Combine 15 complete courses, 150 chapters, 541 topics, live SQL/Power BI/Tableau dashboards, and Scikit-Learn capstones at MSK Institute Shikohabad or Live Online.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext