Created
November 22, 2022 19:31
-
-
Save ncalm/063f0c551dcabe5483ee07fbafdb2c88 to your computer and use it in GitHub Desktop.
Custom function to convert full names like "First Middle Last" to "F.M. Last"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
table as table, | |
column_name as text, | |
new_column_name as text | |
) as table => | |
Table.AddColumn( | |
table, | |
new_column_name, | |
each | |
let | |
Names = Text.Split( Record.Field(_,column_name) , " " ), | |
Initials = List.Transform( Names , each Text.Start(_,1) & "." ), | |
FirstMiddle = Text.Combine( List.RemoveLastN( Initials , 1 ) ) | |
in | |
FirstMiddle & " " & List.Last( Names ) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment