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
gazzo1967
Helper III
Helper III

Copy text from Delimiter Text field to specific Columns

HI All
I have a field that has multiple text strings in it which is delimiter with a semi colon.
What i would like to do is copy each specfic text string to its own column.
I have a single cell with eg
cell 1 = FF1;FF2;FF3;FF4

but there could be a cell1 = FF2;FF4
I would like to write each to its own column.
 My columns would be:
FF1a, FF2a etc

My logic is IF cell1 contains "FF1" copy FF1 to column FF1a
the same would happen for each delimited text.

I know i can split using the delimter but i want each entry to go to it respective column.
Regards Gary


1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

If there are only to be 4 possible values (and therefore 4 columns), you could add 4 custom columns , each one using a slightly different version of : if Text.Contains([the1stColumn], "FF1") then "FF1" else null

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This M code will get you from Image1 to Image2

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnMztHZzMwJiYyA2UYrVAYkZQdixAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Text = _t]),
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Index", {{"Text", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Text"),
    #"Duplicated Column" = Table.DuplicateColumn(#"Split Column by Delimiter", "Text", "Text - Copy"),
    #"Pivoted Column" = Table.Pivot(#"Duplicated Column", List.Distinct(#"Duplicated Column"[Text]), "Text", "Text - Copy")
in
    #"Pivoted Column"

 

Untitled.pngUntitled1.png 


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

If there are only to be 4 possible values (and therefore 4 columns), you could add 4 custom columns , each one using a slightly different version of : if Text.Contains([the1stColumn], "FF1") then "FF1" else null

gazzo1967
Helper III
Helper III

Do i use an EXTRACT for this

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors