Forum Discussion

Candi's avatar
Candi
New Member
2 years ago
Solved

Expression Error We cannot apply operator - to types Text and Text

Hi, I keep receiving this error when trying to run my power query, and I can't figure out how to solve it.  Any help would be appreciated.
  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for reaching out to the community, Candi .

     

    It's an easy question. I reproduced it.

    The step I did was subtract 1 from the [Hours] column, and the reason for the error was that my [Hours] was of type text.(Text cannot be added or subtracted.) 

    Just turn the [Hours] column into a numeric type before performing the subtraction step.

    Of course, if you're not here for addition and subtraction, you're trying to add a "-" between the fields and the fields. Then you can do it as follows.

    Another note, the merge must be text, e.g. [Hours] is a numeric type and not a text type, you need to modify the code as follows

    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.