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
alannavavaldez
New Member

TextAfterDelimiter using another column as the text delimiter

Hello,

Sorry to ask, I had been trying and I was not able to do this... is there a way to split column A using column B as delimiter? I was thinking using TextAfterDelimiter but so far no luck. This is just a short list, but I have like 20 different delimiters in column B and it would help me to have something where I can reference that column.

 

Column AColumn B Column C Result
material 1000 is not okmaterial1000 is not ok
batch 1100 not okbatch1100 not ok
product 1200 is okproduct1200 is ok
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

It's not a proper split, as you usually sacrifice the delimiter symbol(s)

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wyk0sSS3KTMxRMDQwMFDILFbIyy9RyM9W0oHLKMXqRCslJZYkZygYAhUhFIDFwLIFRfkppcklCoZGEDPA0lBBpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column A" = _t, #"Column B " = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Column C Result", each Text.Split([Column A],[#"Column B "]){1},type text)
in
    #"Added Custom"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.

View solution in original post

4 REPLIES 4
dufoq3
Super User
Super User

Hi @alannavavaldez, for your sample data it is enough replace text:

 

Text.Trim(Text.Replace([Column A], [Column B], ""))

 

but if you have delimiter somewhere in the middle - this could help you:

dufoq3_0-1739550411683.png

Text.Combine(List.Select(List.Transform(Text.Split([Column A], [Column B]), Text.Trim), (x)=> x <> ""), " ")

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Vvelarde
Community Champion
Community Champion

Another way is using this: 

 

Text.End([Column A], Text.Length([Column A])-Text.Length([Column B])-1), type text)




Lima - Peru
lbendlin
Super User
Super User

It's not a proper split, as you usually sacrifice the delimiter symbol(s)

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wyk0sSS3KTMxRMDQwMFDILFbIyy9RyM9W0oHLKMXqRCslJZYkZygYAhUhFIDFwLIFRfkppcklCoZGEDPA0lBBpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column A" = _t, #"Column B " = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Column C Result", each Text.Split([Column A],[#"Column B "]){1},type text)
in
    #"Added Custom"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.

thanks! it worked for me

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.

Top Kudoed Authors