Compactness of Sobolev-type embeddings with measures