What happened

Shares of Costco Wholesale (COST -0.24%) took a dive last month after the warehouse retail giant posted disappointing comparable sales for November and followed that up with a middling fiscal first-quarter earnings report.

According to data from S&P Global Market Intelligence, Costco finished December down 15%, an unusually sharp slide for the solid consumer staples stock. As you can see from the chart below, Costco shares dove to start the month and continued to slide from there. 

COST Chart

COST data by YCharts

So what

Costco's worst day of the month came on Dec. 1 when the stock fell 6.6% after it reported November comparable sales with comps adjusted for fuel and currency exchange up just 5.3% globally and 4.6% in the U.S. That marked a noticeable deceleration from earlier in the year, showing that Costco may be feeling the same macro headwinds that much of the rest of the retail sector is. The company also reported another weak round of e-commerce sales, which fell 8.9%.

The retailer followed that up with its fiscal first-quarter earnings report the following week with results mostly in line with estimates. Revenue rose 8.1% to $54.44 billion, which was slightly below the analyst consensus at $54.64 billion. On the bottom line, it reported earnings per share of $3.07, up from $2.98 in the quarter a year ago, but just missing estimates at $3.11.

Costco's gross margin fell by about 60 basis points, showing it's also struggling to pass along higher costs to consumers in an inflationary environment. However, membership growth, which is the company's primary source of profits, was solid, and management also hinted that a membership fee increase was likely in 2023.

Finally, Costco fell another 4% in the broad market sell-off on Dec. 15 after the Federal Reserve raised interest rates again and forecast another 75 basis points of rate hikes in 2023, adding to fears that a recession is coming.

Now what

Costco reports comparable sales each month and its December report is set to come out on Jan. 5, which will give investors an updated snapshot of the company's performance.

Even in a recession, Costco is in a better position than most of its peers because its business is underpinned by its membership model, which gives it a stable income stream. Additionally, its reputation for bargain prices on quality merchandise can help it grow its membership base even in a down economy.

Although the stock still seems expensive at a price-to-earnings ratio of 35, there's no question that Costco's business is one of the best in the retail sector, which explains why the stock is trading at a premium.