On Wednesday, Target (TGT -0.36%) reported earnings results that were even worse than the company had projected when it dramatically slashed its forecast in June. Adjusted earnings per share (EPS) plummeted 89% year over year as the retail giant rolled out big clearance discounts to address a buildup of unwanted merchandise.

However, long-term investors shouldn't worry about Target's bad earnings report. While the second quarter was painful, Target has now addressed much of its aging inventory and is well positioned for a return to earnings growth in the quarters and years ahead.

A kitchen sink quarter

Three months ago, Target reported a 5.3% operating margin for the first quarter. That translated to adjusted EPS of $2.19. At the time, management said that the company's Q2 operating margin might be similar, but it acknowledged a high degree of uncertainty.

Just a few weeks later, Target took a hatchet to its guidance. With demand in discretionary categories (such as home furnishings and big-ticket electronics) slowing abruptly due to the impact of inflation on consumers' discretionary budgets, management decided to implement additional markdowns to clear out slow-moving merchandise. As a result, it updated its Q2 outlook, saying that Target's operating margin would fall to around 2%.

Even this shocking guidance cut proved overly optimistic. Target ultimately recorded a meager 1.2% operating margin for the second quarter. Gross margin plunged to 21.5% from 30.4% a year earlier, mainly due to higher markdowns, inventory impairment charges, and rising freight costs. Adjusted EPS cratered to just $0.39, well shy of the analyst consensus of $0.71.

That said, Target's dreadful earnings report largely reflects management's decision to make the second quarter a "kitchen sink" quarter. Rather than trying to minimize the near-term pain from its excess inventory by carrying extra inventory into the second half of 2022 or even 2023 -- which would likely have led to a long period of subpar results -- Target took its lumps last quarter. This should enable it to post meaningful sequential improvements in its profitability over the next two quarters.

Still gaining market share

While Target barely earned a profit in the second quarter, it still posted a 2.6% comparable sales increase. Total revenue reached $26 billion: up 41% from $18.4 billion in Q2 2019.

In short, Target is holding on to the impressive sales gains it made during the peak of the COVID-19 pandemic. In fact, while sales growth has decelerated, the company's market share (as measured by units sold) still increased last quarter in each of its five major merchandise categories.

Merchandise displays in a Target store.

Image source: Target.

This is a good sign that Target remains a preferred shopping destination for customers. As demand for home furnishings, casual apparel, and electronics rebounds from the current lull -- which is bound to happen before too long -- Target's sales growth should accelerate. In the meantime, the retail giant can rely on its food, beauty, and essentials assortments to keep the top line rising.

No cause for alarm

Target says that it now has an appropriate level of discretionary category inventory. As a result, it reaffirmed its previous estimate that it will generate an operating margin around 6% in the second half of fiscal 2022, which would be a solid result. That forecast incorporates a modest amount of expected margin pressure from clearance activity in the third quarter.

Over the next few years, Target should be able to expand its profit margin by raising prices to recoup higher product costs, returning to historical levels of clearance activity, and capitalizing on a rebound in demand for discretionary purchases.

The outstanding 8.4% operating margin that Target achieved last year probably isn't sustainable in the long run. But all signs point to Target's sales and margins stabilizing well above pre-pandemic levels. That paves the way for Target to start setting new EPS records within a few years.