Forum Discussion

J_o_n_a_s's avatar
J_o_n_a_s
Helper I
1 year ago
Solved

Pivot / Unpivot?

Hi. I got this table below and i want to convert it to the table underneath it. I'm assuming to use Pivot/unpivot but can't figure out how. Thanks for your input!   PM Pro_Key Inv_No Adj_Due ...
  • AlienSx's avatar
    1 year ago
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], 
        tm = List.TransformMany(
            Table.ToList(Source, (x) => x), 
            (x) => List.Split(List.Skip(x, 3), 2), 
            (x, y) => List.FirstN(x, 3) & y
        ), 
        result = Table.FromList(tm, (x) => x)
    in
        result