Yes, that is totally unappropriate. Yet, what offends one person might not offend another.

I am the only female at my job, so I deal with sexual harrassment quite a bit. Personally, I prefer to confront the person first. Some guys think they are just being funny. They do not realize it is offensive. If you are comfortable enough, talk to the guy first and let him know how you feel. If he continues after that, tell someone else.