Forum Discussion

djreyes's avatar
djreyes
Icon for Helper I rankHelper I
3 years ago
Solved

Substitute or Replace text in a column

Hello, 

I have a column that needs to be replaced, instead of 1,2,3 it should be A,B,C. I tried using substitute but can only add 1. May you please help me on what should I do please and thank you!

 

  • Hi djreyes,

     

    The steps performed in Power Query are also stored in the form of M Code. So when you refresh your data manually the "ReplacedValue" step will be performed on the all the new rows.

     

    Did I answer your question? Mark this post as a solution if I did!

3 Replies

  • Shaurya's avatar
    Shaurya
    Icon for Memorable Member rankMemorable Member

    Hi djreyes,

     

    This can be easily done in Power Query. Change the column type to Text if it is a Whole Number. For the three values 1,2,3 go to replace values and enter A,B,C respectively. Doing this will change every occurence of 1 to A, 2 to B and 3 to C.

     

     

    Mark this post as a solution if that works for you!

    • djreyes's avatar
      djreyes
      Icon for Helper I rankHelper I

      Thank you! That's what I did. My data source is excel, was hoping to use a formula so that when I manually refresh it will just update. 

      • Shaurya's avatar
        Shaurya
        Icon for Memorable Member rankMemorable Member

        Hi djreyes,

         

        The steps performed in Power Query are also stored in the form of M Code. So when you refresh your data manually the "ReplacedValue" step will be performed on the all the new rows.

         

        Did I answer your question? Mark this post as a solution if I did!