The objective of this paper is to develop a model to determine the price formation of wholesale electricity markets. For that purpose, we model wholesale electricity prices depending on the prices of fuels (coal and natural gas) and of CO2 emission allowances using a Markov Switching Regression. We apply the model to wholesale electricity prices in the UK and in Germany. While British electricity prices are quite well explained by short-run cost factors, we find a decoupling between electricity prices and fuel costs in Germany. This may be evidence that the German electricity generation sector does not work competitively.