Though home improvement retailer Home Depot (HD 0.86%) managed to report better-than-expected earnings per share for its first quarter on Tuesday morning, the quarterly update still managed to wave a yellow flag for investors.

Not only did first-quarter revenue miss expectations, but comparable sales declined meaningfully year over year. Adding to the reasons for investors to be concerned, management said it now expects comparable sales for the full year to decrease.

Here's a look at Home Depot's results, what they might mean for retail overall, and how investors should navigate what is starting to look like a deteriorating consumer environment.

Warning signs in Home Depot's report

After squeaking by in the fourth quarter of 2022 with a 0.3% year-over-year increase in both revenue and comparable sales for the period, management was bold enough to guide for full-year 2023 comparable sales growth to be "approximately flat." But sales trends are faring below expectations.

First-quarter comparable sales decreased 4.6% year over year, leading to a 4.5% decrease in total sales during the period. Further, management significantly lowered its outlook for full-year revenue; the company now expects total 2023 sales and comparable sales for the year to both decline between 2% and 5%. 

Management said in the company's first-quarter earnings release that it "observed more broad-based pressure across the business, compared to when we reported fourth-quarter results a few months ago."

The biggest negative impact on the quarter was lumber deflation and unfavorable weather, management said. But management raised some concerns about the consumer, too. "We also saw a continuation of the trend we observed in the fourth quarter, with consumers pulling back on big-ticket and some discretionary-type purchases," explained Home Depot executive vice president of merchandising William Bastek in the company's first-quarter conference call. 

Some retailers are more resilient than others

One key lesson from Home Depot's worse-than-expected first-quarter results and management's dampened outlook for the full year is that investors may want to carefully think through the industries the retailers in their portfolios operate in, and consider how well those parts of the economy could potentially hold up in an environment where the consumer is pressured by inflation and higher interest rates simultaneously.

Home Depot CEO Ted Decker certainly didn't seem too surprised by the company's underwhelming performance so far this year. Citing the "three-year period of unprecedented growth" in its sector leading up to 2023, he said in the first-quarter earnings release that he ultimately "expected that fiscal 2023 would be a year of moderation for the home improvement market."

All of this to say that investors should similarly think through recent market trends for the retailers in their portfolios. Did sales surge over the last three years? If so, did the company capture new loyal customers that can help power more growth? Or are sales more likely to moderate, given the trends going on in that particular market or sector?

Further, investors can estimate how much of a retailer's sales are discretionary or nondiscretionary to get a good idea of how resilient sales could be during a recession. Are some sales needs-based, such as groceries and pet food? Are big-ticket item sales by the retailer potentially susceptible to interest rates available to consumers?

Point being, not all retailers are created equal. Costco's (COST 1.01%) comparable sales, when excluding the impacts from changes in gas prices, for instance, actually reaccelerated in April. This adjusted comparable-store sales growth rate was 4.3% last month, up from 2.6% growth in March.

Yes, Costco does sell many discretionary items, but it's also known for its low prices on everyday items like groceries, pet food, and gas. And its discretionary items could benefit from consumers trading down from making purchases at higher-priced retailers. In addition, its business includes a membership model, so the company was able to capture many new customers who started shopping at Costco over the last three years, turning them into regular shoppers that pay a recurring annual fee.

Of course, shareholders of retailers like Home Depot, Costco, and others should be willing to own retailers through a range of market cycles. Otherwise, there's no reason to buy them in the first place. But it's at least helpful to be aware of sector and market trends so investors aren't too surprised when a company's sales miss expectations or when management lowers its full-year sales forecast.

In short, investors should do their homework. They should know the approximate sales composition of discretionary versus nondiscretionary items and the business model of the retailer they're interested in so they can potentially mitigate some of the bad surprises that could surface during a challenging macroeconomic environment.