When something with X in the mana cost is not on the stack, as far as converted mana cost is concerned, X is equal to zero. If it's on the stack, X is equal to the chosen/paid value.