Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Encoding numbers to text

Hello,

 

I have a unique situation where most of my values are coming in as their actual text value, but some are being decoded as a numeric value.  

 

For example, 12345 would be encoded as MTIzNDU=  Basically, I'm only looking to encode the numeric values within the column.

 

With that said, is there a function out there that I can convert just the numeric values to their perspective text values?

 

Thank you for your help.

Pete 

5 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous

    Here are two options for your reference

     First create a custom column

    Custom=Value.Is([value],Int64.Type)

    1. add a conditional column

     

    Corresponding M query:

    = Table.AddColumn(#"Added Custom", "Custom.1", each if [Custom] = true then "Basically" else [value])
    1. Replace values on original column directly.

    = Table.ReplaceValue( #"Added Custom" ,each [value],each if [Custom] = true then "Basically" else [value],Replacer.ReplaceValue,{"value"})

    Best regards,
    Maggie

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Maggie,

       

      Thank you very much.  I will try these solutions and will let you know how I make out.

       

      Regards,

      Pete

      • Anonymous's avatar
        Anonymous
        Not applicable

        When I tried the above solution, the values within my custom column are all set to FALSE, even the numeric values.