Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to: IF statement then a columnA+columnB in power query

Hi All,

 

Hope you are doing great. 
I tried to have a custom column where when Column X ="x" then Column A + Column B else Column A + Column C

But it throw me an error. Down below I include a screenshot for better understanding of my question:

 

Need help in this. Thank you!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    It looks like you are trying to concatenate data.

    This is usually due to you having a column that is not in text format, possibly in numeric format.

    Try to use Number.ToText function to format the numeric value number to a text value

     

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

5 Replies

  • Hi Anonymous ,

     

    Try removing these brackets:

    Pete

    • Anonymous's avatar
      Anonymous
      Not applicable

      Tried that, but still the same.

       

      • Vijay_A_Verma's avatar
        Vijay_A_Verma
        Icon for Most Valuable Professional rankMost Valuable Professional

        You need to use smallcase in If, hence just replace If with if and problem will be solved. You have already corrected the syntax using Ba_Pete's suggestions. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    It looks like you are trying to concatenate data.

    This is usually due to you having a column that is not in text format, possibly in numeric format.

    Try to use Number.ToText function to format the numeric value number to a text value

     

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.