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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.