Measuring the contribution of individual transactions inside the total risk of a credit portfolio is a major issue in financial institutions. Value-at-risk (VaR) contributions and expected shortfall (ES) contributions have become two popular ways of quantifying these risks. However, the usual Monte Carlo approach is known to be a very time-consuming method for computing the risk contributions. In this paper, the authors accurately calculate the ES and decompose the VaR and the ES into a sum of risk contributions from individual obligors representing the marginal impact on the total portfolio risk. They take the Vasicek one-factor model as the model framework.