Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tcboutte
Regular Visitor

Dynamically Create Hierarchy from Flat Table

I have the following table coming in and need to assign hierarchies to it based on the pattern of the numbering convention. This seems like a common need, but I haven't hit on anything that would work so far. The first digit of the code assigns it to a Level 1 parent, the 2nd digit to a level 2 parent, and digits 3 and 4 to a level 3 parent.

 

The table currently looks like this: 

tcboutte_3-1631209207476.png

 

I would want to use DAX expressions or Power Query to populate the level columns like this:

tcboutte_2-1631209154902.png

Thanks!

1 REPLY 1
lbendlin
Super User
Super User

yes, that should be easy. Please provide sample data in usable format (not as a picture - maybe insert into a table?).

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.