Retail sales are still going strong, rising 8.2% in April after increasing 7.3% in March, according to annual data released this week by the Census Bureau.

But the sales figures didn't translate to higher performances by the nation's top retailers, including Target and Walmart.

Instead, both companies reported lackluster first-quarter financial results this week and provided disappointing guidance for the quarter ahead.

“With both Target and Walmart beating on the top line and lowering outlooks on unexpected expenses it certainly raises questions for retailers that have yet to report,” John Zolidis, president of Quo Vadis Capital, told International Business Times.

That was a big surprise for Wall Street, which sent the shares of the two retailers sharply lower following the release of their financial results, prompting a broad sell-off of economically sensitive shares.

What can explain this disconnect between macroeconomic data coming from the Census Bureau and microeconomic data coming from the nation's retailers?

A challenging retailing environment of rising prices for necessities like food, energy and rent leaves very little money in the hands of consumers for discretionary items.

To deal with this environment, low-end retailers like Walmart and Target must give significant discounts to help move inventory of these items.

"Both Target and Walmart said consumers are changing their behaviors in the face of decades-high inflation," Anthony Denier, CEO of online trading platform WeBull, told IBT. "Being forced to spend more money on necessities than during the pandemic leaves them with less to spend on discretionary items, such as apparel and home goods. On top of that, in the face of higher prices, consumers have been pulling back the total amount they spend. However, people did buy a lot of discretionary items during the lockdown, so there might just be less demand for those types of items."

Discounts cut into the operating margins of these retailers.

Rising labor and transportation costs cut into profit margins further.

Target's first-quarter operating profit margin came in at 5.3%, down from 9.8% a year earlier, reflecting higher markdown rates in discretionary items and higher freight and labor costs.

"Our first-quarter results mark Target's 20th consecutive quarter of sales growth, with comp sales growing more than 3 percent on top of a 23 percent increase one year ago," Target CEO Brian Cornell told stockholders in a letter. "Guests continue to depend on Target for our broad and affordable product assortment, as reflected in Q1 guest traffic growth of nearly 4 percent. Throughout the quarter, we faced unexpectedly high costs, driven by a number of factors, resulting in profitability that came in well below our expectations, and well below where we expect to operate over time.”

Cornell is upbeat about the future of Target.

“Despite these near-term challenges, our team remains passionately dedicated to our guests and serving their needs, giving us continued confidence in our long-term financial algorithm, which anticipates mid-single-digit revenue growth, and an operating margin rate of 8 percent or higher over time," he said.

Ethan Chernofsky, vice president of marketing at Placer.ai, is optimistic about Walmart.

"Walmart's traffic shows the retailer's continued pull even amid a difficult economic environment," he told IBT. "While challenges like supply chain issues and wider economic headwinds should dissipate over time, the chain's reach and approach make it a continued force in the retail environment. The continued investments in innovation and the unique pull of its wide offering and value orientation position the retailer for success in the coming months."