Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Need help with Power Query - Creating new rows for non-ending team members

I'm working on a Power Query transformation in Power BI, and I'm facing a challenge that I need assistance with. I have a table with four columns: L0, L1, L2, and L3, representing hierarchical levels...
  • slorin's avatar
    3 years ago

    Hi

     

    = Table.Distinct(
    Table.FromRows(
    List.TransformMany(
    Table.ToRows(Source),
    each {1..4},
    (x,y) => List.FirstN(x,y) & List.Repeat({null}, 4-y)
    ),
    type table [L0 = text, L1 = text, L2 = text, L3 = text])
    )

    Stéphane