Forum Discussion

THEG72's avatar
THEG72
Helper V
8 years ago
Solved

Add New Column in M based on Parent

I have a Table of Accounts which has an Account ID and Parent ID. I want to ADD a new Column in the Query Editor for the Parent Name.   What code should i use to add the new Parent Name field based...
  • ImkeF's avatar
    8 years ago

    You can simply use your current table as a lookuptable and use the Parent ID. Your formula would look like so:

     

    Table.NestedJoin(#"Removed Other Columns",{"ParentAccountID"},#"Removed Other Columns",{"AccountID"},"Source",JoinKind.LeftOuter)

     

    See this little screencast how it works: https://www.youtube.com/watch?v=looCm3cbINw