Let us say that the envelopes contain Y and 2Y "amounts of money". You can only call it x after you have choosen an envelope already. So there are 2 cases and you have to analyse what you will get if you switch:

you have picked Y and called it x
you have picked 2Y and called it x

and this solves the paradox?