cancel
Showing results for 
Search instead for 
Did you mean: 
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.