What happened

Shares of supermarket giant Walmart (WMT -1.69%) were hit hard this week. Shares fell a total of 19.5% by the end of the week -- a huge drop for a stock that is typically less volatile than the overall market.  Even more, the drop was much worse than the S&P 500's 3% decline over the same period.

The cause? There was a big scare in retail during the week, when Walmart and Target (TGT 0.98%) both reported worse-than-expected first-quarter earnings. Both companies cited challenges with operating costs rising more than expected. This sparked a sell-off of many retail stocks.

So what

Walmart's revenue increased 2.4% year over year to $141.6 billion, coming in ahead of analysts' average estimate for revenue of $138.9 billion. But adjusted earnings per share of $130 was well below the consensus forecast for $1.48.

"Bottom-line results were unexpected and reflect the unusual environment," said Walmart CEO Doug McMillon in the company's first-quarter earnings release. "U.S. inflation levels, particularly in food and fuel, created more pressure on margin mix and operating costs than we expected."

A chart showing a stock price declining.

Image source: Getty Images.

Now what

Going forward, Walmart plans to make some adjustments to prices in some areas where cost of goods has increased. This will test both Walmart's pricing power and the consumers' buying power. If the company can strategically raise prices without negatively impacting demand, a margin compression issue can turn into a temporary problem instead of one likely to persist until inflation normalizes.