Forum Discussion

MykytYla's avatar
MykytYla
Frequent Visitor
2 years ago
Solved

How to compare 2 cells text with delimiter and demonstrate difference?

Please, I need your tips.

I have two grouped columns in one table.

How can I compare it and demonstrate the difference? Power Query solution.

I've found VBA but in power query can not 😞

Colors Set A Colors Set B Result A to B Result B to A

 

ABResult A to BResult B to A
red;blue;green yellow;purple;redblue;greenyellow;purple
white;green;redyellow;redwhite;green yellow

 

  • slorin's avatar
    slorin
    2 years ago
    Text.Combine(
    List.Difference(
    Text.Split([A],";"),
    Text.Split([B],";")),
    ";#(lf)"))

    StĂ©phane 

4 Replies

  • Hi, MykytYla 

     

    Result A to B

    Text.Combine(
    List.Difference(
    Text.Split([A],";"),
    Text.Split([B],";")),
    ";")

     

    Result B to A

    Text.Combine(
    List.Difference(
    Text.Split([B],";"),
    Text.Split([A],";")),
    ";")

     StĂ©phane

    • MykytYla's avatar
      MykytYla
      Frequent Visitor

      slorin Thank you so much! 

      It looks such easy but I couldn't handle it.

       

      PS. Could you advise me any good studying for formulas power query and DAX?

  • MykytYla's avatar
    MykytYla
    Frequent Visitor

    can I get cells with text in new line?

    ABResult A to BResult B to A
    red;blue;green yellow;purple;red

    blue;

    green

    yellow;

    purple

    white;green;redyellow;red;purple

    white;

    green

     yellow;

    purple

    • slorin's avatar
      slorin
      Icon for Super User rankSuper User
      Text.Combine(
      List.Difference(
      Text.Split([A],";"),
      Text.Split([B],";")),
      ";#(lf)"))

      Stéphane