I'm importing a hierarchy table in Power Query and it looks like this,
[table="width: 500, class: grid"]
[tr]
[td]Lowest Level[/td]
[td]Level 1[/td]
[td]Level 2[/td]
[td]Level 3[/td]
[td]Level 4[/td]
[td]Level 5[/td]
[/tr]
[tr]
[td]ABC[/td]
[td]D[/td]
[td]E[/td]
[td]F[/td]
[td]ABC[/td]
[td][/td]
[/tr]
[tr]
[td]DEF[/td]
[td]T[/td]
[td]Y[/td]
[td]DEF[/td]
[td][/td]
[td][/td]
[/tr]
[/table]
So basically where the "Lowest Level" column is the leaf member, and then the hierarchy appears to the right, each level as a column.
I'm looking to do two things with this,
1. I need to add a column showing what level the leaf is. In the example above, ABC is a level 4, DEF is a level 3.
2. I want to fill all of the blanks in the levels after the leaf with whatever the leaf member is, so there are no blanks. For instance, above, the level 5 cell in the row would say 'ABC' and the levels 4 and 5 cells of the DEF row would be DEF.
What would be the most efficient way to do this?
Thanks
[table="width: 500, class: grid"]
[tr]
[td]Lowest Level[/td]
[td]Level 1[/td]
[td]Level 2[/td]
[td]Level 3[/td]
[td]Level 4[/td]
[td]Level 5[/td]
[/tr]
[tr]
[td]ABC[/td]
[td]D[/td]
[td]E[/td]
[td]F[/td]
[td]ABC[/td]
[td][/td]
[/tr]
[tr]
[td]DEF[/td]
[td]T[/td]
[td]Y[/td]
[td]DEF[/td]
[td][/td]
[td][/td]
[/tr]
[/table]
So basically where the "Lowest Level" column is the leaf member, and then the hierarchy appears to the right, each level as a column.
I'm looking to do two things with this,
1. I need to add a column showing what level the leaf is. In the example above, ABC is a level 4, DEF is a level 3.
2. I want to fill all of the blanks in the levels after the leaf with whatever the leaf member is, so there are no blanks. For instance, above, the level 5 cell in the row would say 'ABC' and the levels 4 and 5 cells of the DEF row would be DEF.
What would be the most efficient way to do this?
Thanks