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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Betty888
Helper II
Helper II

How to create a new column with a different concatenation

Dear all,

 

I'm not sure what I will descrive will be easy to understand, not even whether it is possible or not, but I'll try ....

I have a table with 3 columns where information were concatenated from source with ";" delimiter. 

what I need to do is to create a new column concatenating inforamtion as here below : 

Current table : 

IDcol1col2col3
ID1Prodouct1 ;Prodouct2;Prodouct2Dose1;Dose2;Dose3Label1;Label2;Label3
ID2Prodouct1 ;Prodouct2;Prodouct3;Product4Dose1;Dose2;Dose3, Dose4Label1;Label2;Label3, Label4

 

My target : 

IDcol1col2col3Col4
ID1Prodouct1 ;Prodouct2;Prodouct2Dose1;Dose2;Dose3Label1;Label2;Label3Product1 Dose1 Label1
Product2 Dose2 Label2
Product3 Dose3 Label3
ID2Prodouct1 ;Prodouct2;Prodouct3;Product4Dose1;Dose2;Dose3, Dose4Label1;Label2;Label3, Label4Product1 Dose1 Label1
Product2 Dose2 Label2
Product3 Dose3 Label3
Product4 Dose4 Label4

 

Do you have any idea how can I createt his new Col4 🙏

Thanks a lot fpr  your help ! 

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @Betty888,

 

Can you please try this: 

Col4 =
VAR Products = SUBSTITUTE([col1], ";", "|")
VAR Doses = SUBSTITUTE([col2], ";", "|")
VAR Labels = SUBSTITUTE([col3], ";", "|")
VAR ProductList = GENERATE(SPLIT(Products, "|"), SPLIT(Doses, "|"), SPLIT(Labels, "|"))
RETURN
    CONCATENATEX(ProductList, [Column1] & " " & [Column2] & " " & [Column3], CHAR(10))

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Combine(List.Combine(List.Zip({Text.Split([col1],";"),Text.Split([col2],";"),Text.Split([col3],";")})),","))
in
    #"Added Custom"

I just do not know how to get the Alt+Enter after every third item in the list.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Sahir_Maharaj
Super User
Super User

Hello @Betty888,

 

Can you please try this: 

Col4 =
VAR Products = SUBSTITUTE([col1], ";", "|")
VAR Doses = SUBSTITUTE([col2], ";", "|")
VAR Labels = SUBSTITUTE([col3], ";", "|")
VAR ProductList = GENERATE(SPLIT(Products, "|"), SPLIT(Doses, "|"), SPLIT(Labels, "|"))
RETURN
    CONCATENATEX(ProductList, [Column1] & " " & [Column2] & " " & [Column3], CHAR(10))

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Works perfectly for me , many many thanks 🙏🙏🙏

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.