Walmart (WMT 0.48%) stock went on a tear following its earnings announcement for the first quarter of fiscal 2025 (ended April 30). The company credited the "persistent demand for value" for its improved results.

Unfortunately, many of its improvements came from outside its noncore business. Such gains are fleeting and could turn into losses in future quarters, which could negatively affect earnings. Although Walmart should remain a solid investment for current shareholders, investors should avoid putting new money to work in this company. Here's why.

Walmart's Q1 results

In many respects, Walmart delivered respectable results. In fiscal Q1, its revenue was $162 billion, a 6% increase from the same quarter last year.

The company derived an approximate 1% benefit from an extra selling day and 21% in its e-commerce segment. Also, since it kept its cost and expense growth in check, operating income grew by 10% to $6.8 billion.

However, even though Walmart's performance steadily improved, much of its $5.1 billion in net income came from outside its operations. The other gains and losses category, which constitutes other investments, experienced a significant swing, moving from its $3 billion loss in the year-ago quarter to a $794 million gain. That improvement accounts for the 205% yearly gain in Walmart's yearly income growth in this quarter.

Other gains and losses may not be the only misperception associated with Walmart stock. When compared to the S&P 500, Walmart underperforms the index over some time periods.

Additionally, the P/E ratio has reached 33. While it is not nearly as costly at Costco and Amazon, it is significantly more expensive than Target and exceeds Walmart's five-year average of 31.

WMT PE Ratio Chart

WMT PE Ratio data by YCharts

Where Walmart stands out

Nonetheless, Walmart holds a notable competitive advantage over online retailers such as Amazon.

Since about 90% of Americans live within 10 miles of a Walmart store, the company employs an omnichannel strategy, allowing customers to use e-commerce or in-store shopping where they see fit.

Also, throughout its history, Walmart has led the way as a low-price leader, leveraging economies of scale and early innovations in IT supply chains to grow its business.

Such innovations helped it fund one major source of total returns, the dividend. At $0.83 per share, new investors earn a forward dividend yield of around 1.3%, a level close to the S&P 500 average. This was a 9% increase from last year.

Moreover, Walmart's Dividend King status especially benefits its longest-term investors. For investors who owned Walmart when it paid its first annual dividend of a split-adjusted $0.000005 per share in 1974, the payout has risen about 166,000-fold during that time!

Admittedly, few current investors have held the stock this long. But thanks to the dividend, if one bought 10 years ago or more, they are likely happy with their returns, even when the stock itself underperforms.

Walmart stock going forward

Ultimately, the retail stock looks more like a hold. While its earnings growth looks impressive, most of its profit growth in fiscal Q1 came from noncore sources. Amid such conditions, it has sometimes underperformed the major indexes.

Indeed, Walmart's business has some compelling attributes. The company has achieved rapid growth in its e-commerce segment, and its store footprint, particularly in the U.S., allows consumers to shop online and in-store, a benefit not offered by an online retailer like Amazon.

Still, the biggest winners with Walmart stock are those who have owned it for years, ideally since the beginning. Between its past gains and the rising dividend income, they have every incentive to stay with the stock.