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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
carmel_owen
Frequent Visitor

Hierarchy in Power Query Editor

I am trying to create a table from data that already has parent details in it, with the aim that there is a text value for each level of the hierarchy, for each 'Name'- I don't know if its my logic thats at fault, or maybe I need to do some further modelling, but I can't work out what to do without doing a massive IF statement for each column? 

 

Below is an example of my table with the data that is already present from the datasource. The 'ID' and the 'Name' columns are unique and I ultimately want for example, for a Level 7 name, the level 6 column should have the name that matches Level 6 for the Parent 6 column, then Level 5 would have the name that matches Parent 5 etc etc. So then when I use a slicer it will have those hierachy steps in? Those columns are currently blank, and I can't work out how to fill them, fill down won't work as the names need to be connected to the 'Parent' column. 

 

 

carmel_owen_0-1690888655740.png

 

1 REPLY 1
carmel_owen
Frequent Visitor

IDParent 1Parent 2Parent 3Parent 4Parent 5LevelNameLevel 7Level 6Level 5Level 4Level 3Level 2Level 1
10000PHL-A-10PHL-A-10-10PHL-A-10-10-10PHL-A-10-10-10-10PHL-A-10-10-10-10-10006tdlnt tdlcdlivcxbldlnulltdlnt tdlcdlivcxbldlnullnullnullnullnull
10900PHL-A-10PHL-A-10-10PHL-A-10-10-10PHL-A-10-10-10-20PHL-A-10-10-10-20-10907dlxtdltncxl Ddlvdllpkpmdlnt Incpkmdldlxtdltncxl Ddlvdllpkpmdlnt Incpkmdlnullnullnullnullnullnull
25000    Unassigned2Intdltncxl Incpkmdl: cxdministtcxtipkn FdldlnullnullnullnullnullIntdltncxl Incpkmdl: cxdministtcxtipkn Fdldlnull
63100PHL-A-10PHL-A-10-10PHL-A-10-10-40PHL-A-10-10-40-10PHL-A-10-10-40-10-63105Scxldl Ptpkcdldlds - Hpkusing  PtpkpdlttidlsnullnullScxldl Ptpkcdldlds - Hpkusing  Ptpkpdlttidlsnullnullnullnull
null    [Account]1Npkt cxppliccxbldlnullnullnullnullnullnullNpkt cxppliccxbldl
nullPHL-A-10   PHL-A-103pkpdltcxting Sutplusnullnullnullnullpkpdltcxting Sutplusnullnull
nullPHL-A-10PHL-A-10-10  PHL-A-10-104TutnpkvdltnullnullnullTutnpkvdltnullnullnull

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.