HELENA, Mont. — Struggles in the energy industry have contributed to Montana taking in less revenue than budget writers had anticipated, making the state’s economic health a campaign issue in this year’s elections.

Republican gubernatorial candidate Greg Gianforte says in campaign stops that his opponent, Democratic Gov. Steve Bullock, has led the state to steep revenue declines and to the erosion of the state’s $350 million rainy day fund.

That ending fund balance, which acts as a cushion against revenue shortfalls and unexpected spending over the state’s two-year budget cycle, stood at $255 million at the beginning of July. Legislative fiscal analysts said the fund could drop below $120 million by mid-2017.

Bullock budget director Dan Villa said the fund is healthy and that the legislative analysts’ forecasts were incomplete. Villa added that some major revenue sources have been picking up recently, such as wage withholdings and corporation taxes.

With the state budget becoming an issue in this year’s elections, here’s a snapshot of some of the biggest factors leading to Montana’s less-than expected revenues:

THE BIG PICTURE:

Montana collected $2.1 billion in general fund revenue over the 2016 budget year, which ended June 30. That is about $142 million less than anticipated in the state’s two-year budget passed in the 2015 legislative session. The revenue expected for the current budget year is also forecast to be $112 million short of what the budget writers anticipated in 2015, according to legislative fiscal analysts.

Gianforte has framed the situation as the state’s revenues being “in a nosedive,” and he places the blame squarely on Bullock. Villa acknowledges the “fiscal volatility” of the state but says Bullock has managed it through cost-cutting measures and by ensuring the state has a healthy rainy day fund.

Villa also says Montana government’s income is diversified enough to absorb steep drops in the price of oil, natural gas and coal.

ENERGY:

Oil, coal and natural gas tax collections dropped due to lower prices and production. Oil production in Montana dropped from 87,000 barrels a day in February 2015 to 64,000 barrels per day in May of this year, and there is currently no new drilling going on in the state.

Oil and gas tax revenue last year was $34 million less than what the state collected the year before. State budget writers anticipated a decline, but not such a sharp one, and the actual revenue collected was $20.2 million short of expectations.

Villa says oil, gas and coal revenues make up less than 3 percent of total general fund revenues and have a small impact on the overall general-fund budget.

However, those taxes also go to a special state revenue account that directly funds some government programs, leaving agencies such as the Department of Environmental Quality, Department of Natural Resources and Conservation and the state Bureau of Mines and Geology to deal with budget shortfalls.

INDIVIDUAL INCOME TAX:

The biggest single source of Montana tax revenue is the individual income tax, which accounts for more than half of the state’s general fund revenue. Montana collected nearly $1.2 billion in income tax revenue over the last budget year. That’s a $9 million increase over the year before, but it was actually $45 million less than the state budget had anticipated. The difference was that tax withholdings did not grow as much as expected and current year payments dropped compared to 2015, according to legislative fiscal analysts.

CORPORATION INCOME TAX:

The low price of oil also has an effect on related industries, such as manufacturing and transportation, where demand for services decline with lower prices. More than a third of Montana’s corporation income tax is tied to the price of oil, according to legislative fiscal analyst Sam Shaefer.

Corporations that saw profits drop paid less in taxes or received tax refunds, resulting in revenues of $61.5 million less than the budget expected.