Forum Discussion

kaye_812's avatar
kaye_812
Frequent Visitor
3 years ago

Merge rows based on the other column but do not combine rows that have different values in other col

I may have worded my problem really bad but it's really hard to explain. This representation might help. The table below is what I want it to look like. Thank you!

11 Replies

  • rubayatyasmin's avatar
    rubayatyasmin
    Community Champion

    Hi, kaye_812 

     

    For Content 1 column: Remove the null values. (by simply opening the table in power query and filter out the nulls)

     

    For content 2 column: Replace null with Tape

     For content 3 column: Replace null with Tumbler

     

    hope this helps. 

     

    If my assistance helps you in any way, hit πŸ‘ and accept the answer as a solution. 

     

    Thanks

    • kaye_812's avatar
      kaye_812
      Frequent Visitor

      Hi, there are other values in Number Column which may also have other values for the conten1, 2, and 3 columns. I can't just simply change null values. Please see attached photo

       

      • kaye_812's avatar
        kaye_812
        Frequent Visitor

        Would you know any way to go about this?

  • Try the solution here:
    https://community.fabric.microsoft.com/t5/Desktop/TRICKY-Move-cell-up-in-certain-columns/m-p/2158720

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJKTAeSIBSrAxEJSM1LzsyBCIaU5iblpBbB5UBCiQWpyMqRhWIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Number = _t, #"Content 1" = _t, #"Content 2" = _t, #"Content 3" = _t]),
        #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Content 1", "Content 2", "Content 3"}),
        Custom1 = Table.FromColumns(List.Transform(Table.ToColumns(#"Replaced Value"), List.RemoveNulls), Table.ColumnNames(#"Replaced Value")),
        #"Filtered Rows" = Table.SelectRows(Custom1, each List.NonNullCount(Record.ToList(_)) > 1)
    in
        #"Filtered Rows"