Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
muhamazh
Frequent Visitor

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

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@muhamazh 

can we create a new table in PQ to get this output? pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@muhamazh 

can we create a new table in PQ to get this output? pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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. 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.