Code:
let
TFR = Table.FromRecords({[Column = "Name"], [Column = "Address"], [Column = "City"], [Column = "State Zip"], [Column = "Telephone"]}),
USC = Table.Unpivot(TFR, {"Column"}, "Attribute", "Value"),
IndexTFR = Table.AddIndexColumn(USC, "Index", 1, 1),
TCC = Table.CombineColumns(Table.TransformColumnTypes(IndexTFR, {{"Index", type text}}, "en-GB"),{"Attribute", "Index"},Combiner.CombineTextByDelimiter(".", QuoteStyle.None),"Merged"),
Pivot = Table.Pivot(TCC, List.Distinct(TCC[Merged]), "Merged", "Value"),
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Filter = Table.SelectRows(Source, each ([raw] <> null)),
Index = Table.AddIndexColumn(Filter, "Index", 0, 1),
IDC = Table.TransformColumns(Index, {{"Index", each Number.IntegerDivide(_, 5), Int64.Type}}),
Group = Table.Group(IDC, {"Index"}, {{"Count", each _, type table}}),
List = Table.AddColumn(Group, "Column", each [Count][raw]),
Extract = Table.TransformColumns(List, {"Column", each Text.Combine(List.Transform(_, Text.From), "="), type text}),
Split = Table.SplitColumn(Extract, "Column", Splitter.SplitTextByDelimiter("=", QuoteStyle.Csv), {"Column.1", "Column.2", "Column.3", "Column.4", "Column.5"}),
RC = Table.RemoveColumns(Split,{"Index", "Count"}),
TC = Table.Combine({Pivot, RC}),
Promote = Table.PromoteHeaders(TC, [PromoteAllScalars=true])
in
Promote
Bookmarks