Does bike type/geometry affect power?

My Pivot Mtb didn’t have the right gearing for Zwift. I was fine on the climbs but really frustrated on the flats. It’s worth buying a road bike