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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

remove the first name which is concatenated with the lastname

I have some data being pulled from a power query however I need to split a cell into a proper name. I dont know where to start from, stuck after splitting them by a delimiter.

 

SourceRequired
Tyrell BrunotyrellTyrell Bruno
Isaias McHargisaiasIsaias McHarg
Monique DanfordmoniqueMonique Danford
Jabari CardenjabariJabari Carden
Myles NeedhammylesMyles Needham
Juliana JamesjulianaJuliana James
Parker AlmeidaparkerParker Almeida
Keshawn GrecokeshawnKeshawn Greco
Evelin BurgoyneevelinEvelin Burgoyne
Desiree CrittendendesireeDesiree Crittenden
Jonathon SlaterjonathonJonathon Slater
Aurelia CloughaureliaAurelia Clough
Paola PizarropaolaPaola Pizarro
Alivia BinghamaliviaAlivia Bingham
Princess Filey Maria AcklandprincessPrincess Filey Maria Ackland

 

No definitive number of characters in each cell, but I need to show just Tyrell Brunotyrell as Tyrell Bruno
1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Here's one way to do it in the query editor.  To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fZHLbsIwEEV/ZZQ1P8GjLyoQUrtDLKbJlAxxxnScUKVfX3vMAlOpkhc5d45vZHu/r94nJedgoaP4wb6rWRFWh9m+egnIGGBTP6Me2SBqRWrexgt/jQQrlE+vTZ8xqncDk9f4gcqwRG1ITgbRLNJcOjkKsCVqWuz7BKnwNsx1o2MUhDX2FE4ZUt9tbOIOtSOFueuJGzwbRbGMzXyl0OK3wJNS7bsM0SxiEx8u5FhgMerRT0JkGM273NwVBVYiWCoPA0mTliXR/zvLR/OCQ+sF3hwOpKcrptOVE7PnY3w9Rlg6Px5bzBTdMr9ehXcIO/5BVX9OYBdxE+ZGx5e4ccES+3o0SoVFnAuVpaYQ4JEdTbCJT4kwrzuH0pyvs/SLf7TqcPgF", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Source = _t, Required = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Source", type text}, {"Required", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each let 
firstname = Text.Lower(Text.BeforeDelimiter([Source], " "))
in 
Text.Replace([Source], firstname, ""))
in
    #"Added Custom"

 

Pat

Microsoft Employee

View solution in original post

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Here's one way to do it in the query editor.  To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fZHLbsIwEEV/ZZQ1P8GjLyoQUrtDLKbJlAxxxnScUKVfX3vMAlOpkhc5d45vZHu/r94nJedgoaP4wb6rWRFWh9m+egnIGGBTP6Me2SBqRWrexgt/jQQrlE+vTZ8xqncDk9f4gcqwRG1ITgbRLNJcOjkKsCVqWuz7BKnwNsx1o2MUhDX2FE4ZUt9tbOIOtSOFueuJGzwbRbGMzXyl0OK3wJNS7bsM0SxiEx8u5FhgMerRT0JkGM273NwVBVYiWCoPA0mTliXR/zvLR/OCQ+sF3hwOpKcrptOVE7PnY3w9Rlg6Px5bzBTdMr9ehXcIO/5BVX9OYBdxE+ZGx5e4ccES+3o0SoVFnAuVpaYQ4JEdTbCJT4kwrzuH0pyvs/SLf7TqcPgF", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Source = _t, Required = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Source", type text}, {"Required", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each let 
firstname = Text.Lower(Text.BeforeDelimiter([Source], " "))
in 
Text.Replace([Source], firstname, ""))
in
    #"Added Custom"

 

Pat

Microsoft Employee

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors