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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

delete everything before the last transcription of a string

Hello,


Data = "aaaa eeee rrrr ttttt yyyy uuuu aaaa ffff hhhh aaaa cccc"


I'm trying to delete everything before the last "aaaa" on each cell.


Output "line 4" should be "aaaa cccc"

Output "line 5" should be "aaaa"

 

cher90_0-1662648204450.png

 

Thanks!

Amine

 

1 ACCEPTED SOLUTION
AntonioM
Solution Sage
Solution Sage

Hi @Anonymous ,

 

You could try

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSgQChVQgUCgCAoUSEFCoBAKFUiBQAEunAYFCBhBAuMlAoBSrE60E1gYSUoqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [data = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"data", type text}}),
    #"Extracted Text After Delimiter" = Table.TransformColumns(#"Changed Type", {{"data", each Text.AfterDelimiter(_, "aaaa", {0, RelativePosition.FromEnd}), type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Extracted Text After Delimiter",each [data], each "aaaa " & [data] ,Replacer.ReplaceValue,{"data"})
in
    #"Replaced Value"

 

 

Two steps here. First extract everything after the first "aaaa" from the end and then add "aaaa " back to the front.

 

AntonioM_0-1662649396757.png

AntonioM_1-1662649403706.png

AntonioM_2-1662649409309.png

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Worked thanks!

AntonioM
Solution Sage
Solution Sage

Hi @Anonymous ,

 

You could try

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSgQChVQgUCgCAoUSEFCoBAKFUiBQAEunAYFCBhBAuMlAoBSrE60E1gYSUoqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [data = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"data", type text}}),
    #"Extracted Text After Delimiter" = Table.TransformColumns(#"Changed Type", {{"data", each Text.AfterDelimiter(_, "aaaa", {0, RelativePosition.FromEnd}), type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Extracted Text After Delimiter",each [data], each "aaaa " & [data] ,Replacer.ReplaceValue,{"data"})
in
    #"Replaced Value"

 

 

Two steps here. First extract everything after the first "aaaa" from the end and then add "aaaa " back to the front.

 

AntonioM_0-1662649396757.png

AntonioM_1-1662649403706.png

AntonioM_2-1662649409309.png

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.