Source: Wikimedia Commons

After Costco Wholesale (COST 1.01%) reported earnings for the second quarter of its 2014 fiscal year, shares of the retailer fell more than 2%. The company saw some attractive revenue growth for the quarter. But its earnings fell far short of what analysts expected, perhaps signaling that times could get more challenging for the retailer. In spite of these troubles, should the Foolish investor take this moment to buy Costco shares at a discount, or is the unfavorable downturn in business a sign that the company might be too risky?

Costco just couldn't live up to expectations
For the quarter, Costco reported revenue of $26.3 billion. This represents a 6% jump compared to the $24.9 billion the company reported in the year-ago quarter, but falls shy of the $26.7 billion analysts anticipated. In its earnings release, management attributed the company's lackluster revenue growth to regional comparable-store sales results: the company experienced flat performance in its international segment combined with a 4% rise in the U.S.

However, if it weren't for gas-price deflation and foreign exchange rate fluctuations, the company's comparable-store sales would have expanded 7% abroad.

Looking at profits, Costco performed even worse during the quarter. Instead of the $1.17 per share that analysts hoped to see, the company's profitability only came in at $1.05 per share. When you consider that the business reported earnings of $1.24 per share in the year-ago quarter, the picture looks even worse.

According to Richard Galanti, Costco's CFO, the business was negatively affected by "weaker sales and gross margin results in certain non-foods merchandise categories, particularly during the four-week holiday selling season; weaker gross margins in our fresh foods business; and lower reported international profits, resulting from the significant weakening of foreign exchange rates."

But how does Costco stand up to its peers?
Over the past few years, Costco has been on a real tear. Between 2009 and 2013, for instance, the company reported sales grew 47% from $71.4 billion to $105.2 billion. This growth has been due to both a rise in store count as well as an increase in comparable-store sales over time.

During the same time frame, Costco's profits were more impressive. Over the past five years, the business saw its net income rise 88% from $1.1 billion to $2 billion. This jump in net income can be chalked up to an increase in revenue over time as well as increased economies of scale; the business saw its aggregate cost of goods sold and selling, general, and administrative expenses fall from 97.5% of sales to 97.1%.

Source: MSN Money

In comparison, neither Wal-Mart Stores (WMT -0.08%) nor Target (TGT 0.18%) have done as well. Over the past five years, Wal-Mart's revenue rose only 17% from $408.1 billion to $476.3 billion. Meanwhile, net income increased only 11.5% from $14.4 billion to $16 billion. Target hasn't been so lucky. Over this same period, the company's revenue rose 11% from $65.4 billion to $72.6 billion, while net income fell 21% from $2.5 billion to $2 billion.

The primary reason for the lackluster rise in profitability for both Wal-Mart and Target has been each company's cost of goods sold and selling, general, and administrative expenses in relation to sales. In aggregate, these expenses rose from 94.1% of sales to 94.4% for Wal-Mart and from 89.7% of sales to 91.7% for Target.

Probably the only significant retailer to outperform Costco in both revenue growth and net income growth was Whole Foods Market (WFM). Over the past five years, the company saw its revenue rise 61% from $8 billion to $12.9 billion, while net income soared 275% from $146.8 million to $551 million. In aggregate, the company's cost of goods sold and selling, general, and administrative expenses decreased from 96.5% of sales to 93.2%.

Foolish takeaway
Despite seeing a mediocre quarter, Costco has had one nice run these past few years. In fact, the company's performance has been so great that only Whole Foods has been able to surpass its record. Moving forward, it's difficult to tell whether the company will continue to grant investors the same opportunities it has in the past. However, even if Costco isn't able to replicate its past performance in the years to come, it appears very possible that it will at least outdo Wal-Mart and Target.