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
Scott
Frequent Visitor

How to split a variable number of items in a cell into rows, and copy the contextual column data

I have the following:

 

Table 1
Serial NumbersInvoice
123,124,125333
126444
127555
128,129666

 

and 

 

 

Table 2
Serial NumberCusID
123ben
124suzy
125craig
126allison
127cindy
128arun
129amy

 

and I want:

 

Table 3
Serial NumberCusIDInvoice
123ben333
124suzy333
125craig333
126allison444
127cindy555
128arun666
129amy

666

 

The trick is that the number of entries in "Serial Numbers" is variable, and the data comes from a Web Query, so a 1-time conversion in Power BI Desktop won't work on an ongoing basis. 

 

Help? 

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi @Scott

 

What you can do is if you have both your tables in the Query Editor, you can split Table1 by Delimeter (which will be the comma) and if you click on the Advanced Options you can then select to "Split Into - Rows"

 

 

Then once that is done you can then Merge Table1 with Table2 joining on the Serial Numbers. Which should then give you the final output for Table3.





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

Proud to be a Super User!







Power BI Blog

View solution in original post

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @Scott

 

What you can do is if you have both your tables in the Query Editor, you can split Table1 by Delimeter (which will be the comma) and if you click on the Advanced Options you can then select to "Split Into - Rows"

 

 

Then once that is done you can then Merge Table1 with Table2 joining on the Serial Numbers. Which should then give you the final output for Table3.





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

Proud to be a Super User!







Power BI Blog

That's fantastic. 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.