Forum Discussion

homboy27's avatar
homboy27
Helper III
5 months ago
Solved

Combine 2 rows into 1

  Please see above. I have a data that has some information on row 1 and some on row 2. Is there a way to combine these 2 rows into 1 row  and make it a header?
  • Ahmedx's avatar
    Ahmedx
    5 months ago

    pls try

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJBIMfc/NK8EiAjJLEitRhIO5cWFaXmJVeChPJLEnOA4gowtoJbKlBNrE60knNOZipYm3NmCUhpcEliSSqICzKtqBLZBhACaakAMvBjqqqKBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
        from =  Table.ColumnNames(#"Changed Type"),
        NM1 = List.RemoveMatchingItems(Table.ToRows(#"Changed Type"){0},{""}),
        NM2 = List.RemoveMatchingItems(Table.ToRows(#"Changed Type"){1},{""}),
        nam =NM2 & NM1,
        final =Table.RenameColumns(#"Changed Type" , List.Zip({from,nam})),
        #"Removed Top Rows" = Table.Skip(final,2)
    in
      #"Removed Top Rows"