Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Separating Delimited column with multiple delimiters

Hi everyone,

I had an unpivoted table of the form:

ID          Item           Color

1             A                   red

1             B                   red

2             C                   red

2            D                    red

2             E                    red

 

I wanted to combine two rows into one depending on the ID and I was able to get the following output:

1               A,B            red

2               C,D,E          red

 

However, I only want unique pairs like A,B and not C,D,E. The C,D,E should be separated as C,D and C,E and D,E.

 

Can anyone help with this conversion?

 

P.S: I am doing this in dax and have to remain inside dax. No use of power query for it is possible. Best

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for providing me with the solution. I have one last question.

      I also have IDs that have singular values i.e not two or three different values. Like....

      ID             Item                Color

      1                F                     red

      2               G                     red

      3               H                     red

      4               I                       red

      5              J                       red

       

      Is there a way to handle these values simultaneously alongside the pairs? Because the procedure takes out these singular values. Something that can create an F,F and H,H and J,J kinda combinations for singular values. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        I found the solution to this too. I just created another table with non-duplicates and appended the two tables together as they all had different and unique ids, which made the append easier. Thank you so much