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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors