"you have to choose one or the other; cannot have your cake..." When children are allowed to make choices, they learn that they can't have it both ways.
CAN'T HAVE IT BOTH WAYS
Meaning of CAN'T HAVE IT BOTH WAYS in English
English idioms vocab. Словарь английских идиом и выражений. 2012