Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Changing the row entries

I have a column called DEASCH that has a few distinct entries that I need to change. I need to use some sort of "IF C48676 then 3" statement to change all of the following entries. The blanks, empty ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

    You can add a custom column in Power Query Editor with the below applied codes, please find the attachment for the details.

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcgzydVbSUTKwNACSSrE6aCIKmELOxhYGJmaHFmCRMbEwMzfFIW6GQ9wch7glLpspt5d4GynRO3DhNNAisQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [FACILITY = _t, #"FACILITY ID" = _t, DEASCH = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"FACILITY", type text}, {"FACILITY ID", type text}, {"DEASCH", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.Trim([DEASCH])<>"" and [DEASCH]<>"C38046" then 3 else [DEASCH])
    in
        #"Added Custom"

    Best Regards