Earnings from US retailers, together with fresh figures on port volumes and retail sales, are showing the effects of red-hot inflation on both consumer spending and the logistics networks that are trying to match frayed supply chains with shifting demand.

Walmart, Target and others are seeing consumer preferences shift to basic goods including food and home essentials. At the same time, shoppers are putting the brakes on purchases of furniture and electronics compared with a year ago, new Commerce Department data showed.

Such changes in spending behavior — combined with over-ordering earlier this year — have left the people who manage supply chains with a costly mess. Products that don’t entice shoppers sit unsold in stores and warehouses, taking up valuable space.

Walmart, which saw inventory levels jump by almost one-third in the first quarter, canceled billions of dollars in orders and slashed prices on items such as apparel. In the second quarter, it reduced the number of shipping containers in its system by half to match stockpiles with demand, and inventory growth slowed to 25% from a year earlier, compared with a 32% increase in the first quarter.

Still, “it’s going to take a few more months to work through the backlog,” John Furner, head of the company’s US operations, told analysts on a call.

Target executives said they had mostly worked through the problem after an all-hands effort. But tackling the bloat came at a big cost: The company’s earnings badly trailed analyst estimates as the retailer moved aggressively to reduce the supply of discretionary goods.

Meanwhile, throughput at the ports has improved and while imports are still robust at Los Angeles, they’ve fallen for two straight months at Long Beach and Oakland.

That mixed picture was summed up in minutes released Wednesday of the Federal Reserve’s most recent policy-setting meeting.

“A few participants indicated that some business contacts had assessed that demand and supply were beginning to come into better balance,” the minutes said. “Even so, contacts in many areas continued to report major supply-chain disruptions and anticipated that these were likely to continue while also indicating that there were signs of improvement in supply conditions in some areas.”