Forum Discussion

jsherman-q's avatar
jsherman-q
New Member
6 years ago
Solved

replace value in column1 using value in column2

I am trying to remove the vlaue of column1 from column2. For example, column1 has the file extension of a file name in column2, I would like to remove the file extension from column2. So sort of a dy...
  • AlB's avatar
    AlB
    6 years ago

    jsherman-q 

    Please always share a sample of your data to make it easier for those trying to answer

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W0iupKFHSUcpLzE01BLNjdYCCqRWpUEEjMBssmJQIU2kMZsfGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Replace([Column2],[Column1],""))
    in
        #"Added Custom"

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers