Forum Discussion

tcboutte's avatar
tcboutte
Regular Visitor
4 years ago

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: 

 

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

Thanks!

1 Reply

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