I have the following table (as result of many steps) :
I want to get a result as below : as I need to transpose the table :
I have the following table (as result of many steps) :
I want to get a result as below : as I need to transpose the table :
This will do. In your case NumberOfColumns is at least 19.
For explanation of essential line
ToTable = Table.FromRows( List.Split( Source[Column.1.2], NumberOfColumns) )
visit The BI Accountant
let
NumberOfColumns = 3
, Source = Table.FromRecords({
[Column.1 = "country", Column.1.2 = "afghanistan"],
[Column.1 = "capital", Column.1.2 = "kabul"],
[Column.1 = "currency", Column.1.2 = "afghani"],
[Column.1 = "country", Column.1.2 = "slovakia"],
[Column.1 = "capital", Column.1.2 = "bratislava"],
[Column.1 = "currency", Column.1.2 = "eur"]
})
, ToTable = Table.FromRows( List.Split( Source[Column.1.2], NumberOfColumns) )
, OldHeader = Table.ColumnNames(ToTable)
, NewHeader = List.FirstN(Source[Column.1],NumberOfColumns)
, RenameHeaders = Table.RenameColumns(ToTable, List.Zip({OldHeader, NewHeader}))
in
RenameHeaders
before:
after: