That with and the like at the end of the sentence is very typical of English (and some other Germanic languages), but it is absolutely un-Slavic in general and un-Ukrainian in particular. That is called "hanging prepositions", Ukrainian does not allow that and it always moves those prepositions into the middle of the sentence. If we take your example, Ukrainian will put the words in it in such an order:
..., but I don't have anyone to go with → ..., but I don't have anyone with whom to go
That particular sentence in Ukrainian is:
Я б пішов (masc.)/пішла (fem.) на танці, та немає з ким.
As you can see, since the preposition is no more hanging into the abyss of the end of the sentence, there must be something to follow it, which is usually the pronouns хто "who" or що "what" in the case which is demanded by the preposition. In your example it is ким which is хто "who" in the Instrumental case, for з needs Instrumental.