Liam Denning is a Bloomberg Gadfly columnist covering energy, mining and commodities. He previously was the editor of the Wall Street Journal's "Heard on the Street" column. Before that, he wrote for the Financial Times' Lex column. He has also worked as an investment banker and consultant.

Tesla went from zero to 100 in three months -- which, granted, doesn't sound that impressive. Without it, though, the electric-car pioneer might not have beaten earnings forecasts this week.

I'm referring to zero-emission vehicle, or ZEV, credits. California and several other states require that a certain proportion of the vehicles sold by an automaker emit no greenhouse gases. These cars earn the automaker credits, and if they don't have enough to meet their quota, they can buy extra ones from someone who does. As Tesla only makes vehicles that run on batteries and emit nothing, it usually has a surplus for sale.

In the second quarter, Tesla earned $100 million in revenue from selling ZEV credits, having sold none in the prior quarter. The profit margin on these is very high, perhaps 95 percent. The implied $95 million of profit equates to about 58 cents a share. Tesla reported a loss of $1.33 per share this week -- beating the consensus forecast by 55 cents.

This isn't the only time ZEV credits have played a big role for Tesla. Looking back to early 2013, selling credits has given Tesla's earnings extra oomph in many quarters, likely taking them above consensus forecasts in some (on an implied basis, assuming that 95 percent margin):

One notable period there is the the third quarter of 2016. This was the one where CEO Elon Musk exhorted his employees to "throw a pie in the face" of Tesla's critics by delivering thumping results. It worked, although at the cash-flow level it also owed quite a bit to suppliers.

But ZEVs provided a big tailwind: At $139 million, Tesla booked more revenue from selling the credits that quarter than any other. Using my margin assumption, they added 84 cents per share to earnings, turning a loss of 13 cents into a profit of 71 cents.

To be clear, there is some double-counting here because analysts factor some ZEV sales into their forecasts, and I don't know what the consensus is for that particular line item. The range of estimates is likely to be fairly wide, because Tesla's pattern of booking ZEV sales looks pretty random.

For example, Barclays analyst Brian Johnson was forecasting $15 million of ZEV revenue ahead of the latest quarter's results, while Morgan Stanley's Adam Jonas had penciled in about $33 million.

Stop And Go
Tesla's revenue from sales of ZEV credits swings around wildly ...
Source: Company filings and shareholder letters
Volatile Share
... and there doesn't appear to be any pattern as a proportion of overall revenue, either
Source: Company filings and shareholder letters, Bloomberg
Note: ZEV credit sales as a proportion of Tesla's revenue.

So if we could strip out analysts' assumptions for ZEV revenue, consensus forecasts would be a bit lower than they actually are.

Still, it's clear ZEV, and other credits based on limiting greenhouse gases, have played a significant role in Tesla's bottom line. Based on that assumed margin, they helped get Tesla's annual earnings into the black in 2013 and 2014 and mitigated losses in other years:

For investors, there's nothing wrong with Tesla making money from ZEVs -- that is one of the perks of making electric vehicles under current regulations; and, given the company's ferocious rate of cash burn, it needs that perk.

But it's a complicated perk. Earnings expectations for Tesla are highly malleable things anyway: A year before Wednesday, analysts were forecasting a second-quarter profit of 63 cents a share, but that had come down to an expected loss of $1.88 by the time the numbers actually hit, according to data compiled by Bloomberg. The ZEV factor adds a whole other layer of complexity to that, and one that can play an outsize role. 

Against this, it's worth remembering that, on an important level, Tesla's earnings don't really matter anyway.

-- With graphics by Chloe Whiteaker

This column does not necessarily reflect the opinion of Bloomberg LP and its owners.

To contact the author of this story:
Liam Denning in New York at

To contact the editor responsible for this story:
Mark Gongloff at