There's a simple reason why investors are willing to pay a premium for Costco Wholesale (COST -0.80%) stock: steady growth in sales and earnings. Costco's consistency in the face of rising online competition has allowed it to post a total return of 127% over the past five years, compared to just 33% for Wal-Mart (WMT -0.14%).

COST Total Return Price Chart

Costco vs. Wal-Mart Total Return. Data by YCharts.

The risk for investors is that Costco stock is fairly pricey: it currently trades for 26 times its projected fiscal 2016 earnings. If for any reason Costco's sales performance weakens, that earnings multiple could contract significantly. Unfortunately, sales growth has been slipping recently at Costco.

Strong sales trends in 2015
During fiscal 2015, Costco's comparable store sales rose 1% year over year. This number may not seem all that impressive, but lower gasoline prices and the strong dollar both weighed on Costco's sales results throughout the year.

Excluding those two factors, Costco posted comp sales growth of 7% for the full fiscal year, consisting of 6% growth in the U.S. and 7% growth abroad. Sales trends remained roughly stable in the first quarter of fiscal 2016. Comp sales rose 6% year over year in the U.S. and for the company as a whole, excluding the impacts of gas price deflation and the strong dollar.

Costco's strong sales trends in the U.S. contrasted with sluggish growth at Wal-Mart. Including both Walmart and Sam's Club, Wal-Mart posted domestic comp sales growth of about 1% during this period.

Sales growth slipping?
Costco was reporting strong sales growth in the U.S. as recently as Thanksgiving Day weekend, which seemed to bode well for its performance in December.

As recently as November, Costco's sales trend was strong. Image source: The Motley Fool.

However, sales growth started to slow in December, particularly in the domestic market. Costco reported comp sales growth of 4% in the U.S. that month, excluding gas price deflation. This was a solid result compared to what big-box competitors like Wal-Mart have managed lately, but it was still below Costco's typical standard.

The sales trend worsened in January. Costco reported comp sales growth of just 1% in the U.S. last month. The company's management team attributed part of this weakness to severe winter weather that affected some of its domestic markets and a shift in the timing of the Super Bowl. Costco estimates the combined impact of these two factors as a 1.75 percentage point drag on January domestic sales.

Nevertheless, even excluding these factors, Costco would have only posted 3% comp sales growth in the U.S. Its comparable store sales trend appears to be converging with that of Wal-Mart -- we'll have to wait for the latter's earnings report later this month to be sure -- which is bad news for maintaining a premium valuation.

Don't panic -- yet!
Costco's monthly sales results are affected by a wide range of factors, ranging from weather to competition to commodity prices. Investors shouldn't panic just because sales growth has been trending down in the past few months. Costco has a long track record of steady growth and membership trends have remained solid. Thus, there's a good chance that Costco will get back on track in the coming months.

This sales slowdown is still a key issue to watch, though. If low single-digit domestic comp sales growth becomes the norm, Costco's earnings multiple could start to converge toward those of Wal-Mart and other slow-growth retail giants.