Forum Discussion

Scott4850's avatar
Scott4850
Frequent Visitor
2 years ago
Solved

Pivot with Multiple Columns?

Obviously I'm not very knowledgeable about this, but I did think I could do this fairly easily with a Pivot, UnPivot, or Transpose...or some combination therof.  But I am stumped.   I can pivot on ...
  • AlienSx's avatar
    2 years ago
        fx = (tbl) => #table(
            {"Project"} & List.Combine(List.Transform(tbl[Task], (x) => {x & " (Start)", x & " (Finish)"})),
            {{tbl{0}[Project]} & List.Combine(Table.ToRows(tbl[[Start], [Finish]]))}
        ),
        group = Table.Group(
            your_table,
            "Project", 
            {"x", fx}
        ),
        combine = Table.Combine(group[x])