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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to seperate particular text from a column and paste into another column.

Need to find "L0", L1" form column A and paste only the "L0", "L1" into column B.

Yoganandhan_01_0-1708507267746.png

 

Thanks..

1 ACCEPTED SOLUTION

but if you need it here's the full code from the query:

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sxLy7dS8DFQitWJVgpKTbNScPRxQXB8DJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "Custom.1", each let
L0Index = Text.PositionOf([Column1], "L0"),
L1Index = Text.PositionOf([Column1], "L1"),
L0 = if L0Index <> -1 then Text.Middle([Column1], L0Index, 2) else null,
L1 = if L1Index <> -1 then Text.Middle([Column1], L1Index, 2) else null,
Result = if L0 <> null and L1 <> null then L0 & ", " & L1 else if L0 <> null then L0 else if L1 <> null then L1 else null
in
Result)
in
#"Added Custom1"

 

DOLEARY85_0-1708509183343.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

5 REPLIES 5
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

you can do this in power query using a custom column. Try this:

 

let
L0Index = Text.PositionOf([Column1], "L0"),
L1Index = Text.PositionOf([Column1], "L1"),
L0 = if L0Index <> -1 then Text.Middle([Column1], L0Index, 2) else null,
L1 = if L1Index <> -1 then Text.Middle([Column1], L1Index, 2) else null,
Result = if L0 <> null and L1 <> null then L0 & ", " & L1 else if L0 <> null then L0 else if L1 <> null then L1 else null
in
Result

 

DOLEARY85_0-1708507658014.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Anonymous
Not applicable

Hello @DOLEARY85

 

Thanks for your reply. I do face some Token EoF Error. Because of the the comma on the end of the first line. 

Yoganandhan_01_0-1708508025187.png

Could you please send me your custom coloumn formula on the query editor. That helps me a lot rather then normal copied text.

Thanks..!

You just need to add:

 

in
Result

 

to the bottom of the code you have there

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

but if you need it here's the full code from the query:

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sxLy7dS8DFQitWJVgpKTbNScPRxQXB8DJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "Custom.1", each let
L0Index = Text.PositionOf([Column1], "L0"),
L1Index = Text.PositionOf([Column1], "L1"),
L0 = if L0Index <> -1 then Text.Middle([Column1], L0Index, 2) else null,
L1 = if L1Index <> -1 then Text.Middle([Column1], L1Index, 2) else null,
Result = if L0 <> null and L1 <> null then L0 & ", " & L1 else if L0 <> null then L0 else if L1 <> null then L1 else null
in
Result)
in
#"Added Custom1"

 

DOLEARY85_0-1708509183343.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Anonymous
Not applicable

Thanks for your reply.!

 

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 Solution Authors
Top Kudoed Authors