You can stack and replace segments within the Calculated metric builder.
Begin building a metric, as described in Build metrics.
In the Definition canvas, drop the new segment next to the existing one:
Begin building a metric, as described in Build metrics.
In the Definition canvas, drop the new segment on top of the existing one: