Forum Discussion
silvias
4 years agoHelper I
Transpose only two row
HI, I have a table like the following: ID CARACT VALUE a1 caract1 value1 a1 caract2 value2 a2 caract1 value3 a2 caract2 value4 I would like to transform it into: ...
smpa01
4 years agoCommunity Champion
silvias try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSjRU0lFKTixKTC4BscoSc0pTDZVidVBkjGAyRhAZI0w9xugycD0mSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, CARACT = _t, VALUE = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"CARACT", type text}, {"VALUE", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[CARACT]), "CARACT", "VALUE")
in
#"Pivoted Column"