Beside desirable outputs, farming generates environmentally harmful by-products. In this article, we include nitrogen surplus of farms in the representation of the production technology and assessed performance of farms. We measure environmental efficiency (EE) in the framework of a translog output distance function. EE shows by how much a farm can reduce its nitrogen surplus, given multiple inputs and multiple outputs. The study use bookkeeping data on dairy farms in the mountainous region of Switzerland. The analyses show that considering nitrogen surplus has a minor effect on the ranking of farms in terms of technical efficiency. Further, the results indicate relatively low average values for EE, suggesting a need for additional policy measures to reduce farm nitrogen surpluses.