Forum Discussion

montibellin's avatar
montibellin
Icon for Helper I rankHelper I
3 years ago
Solved

power query hierarchy's calculation

Hi Guys, I'm searching a method to calculate in an additional column the hierarchy on column1 based on the parent relationship reported in column2.  Basically the root level is Leve1 when "locati...
  • montibellin's avatar
    montibellin
    3 years ago

    it works only in this case, when the values don't change. Otherwise I need to update code every time.

    I'm found a solution using Merge funciton applied on the same table.

    in the result it's necessary to select "lev 1", that can be renamed in "lev 2", then filter "lev 0" = "location"
    this is the result