Fortunes shift in every industry, and the winners in one era often struggle in the next. That's been the story for Whole Foods Market (NASDAQ:WFM) and Wal-Mart (NYSE:WMT), both of which have had to deal with changing trends in their respective industry niches that have threatened their once-dominant business models. Whole Foods has faced increased competition in organic and natural foods as its competitive advantage has proven to be fragile, while Wal-Mart has had to deal with rising costs and online competition that have hampered its ability to offer the lowest prices possible. Value-oriented investors see opportunities in both stocks, but they want to know which one looks better right now. Below, we'll compare Whole Foods and Wal-Mart using a number of metrics designed to reveal which is the more attractive stock right now.

Valuation and stock performance

Neither Whole Foods nor Wal-Mart has produced huge returns recently, but Wal-Mart has done slightly better. The big-box department store has given investors a 9% total return since February 2016, compared to just 3% for the natural and organic grocer during the same period.

Happy shoppers walking out of a Wal-Mart store.

Image source: Wal-Mart.

Yet even though Whole Foods hasn't done as well lately, investors still give it a much higher valuation than they give Wal-Mart. Looking at trailing earnings, Whole Foods stock trades at 22 times what the grocer has brought in on the bottom line over the past 12 months. Wal-Mart carries a lower trailing earnings multiple of just 15. Moreover, given the relatively downbeat expectations for future earnings growth from the two companies, looking at forward-earnings-based metrics doesn't change the picture much. Wal-Mart still has the lead with a forward multiple of 16 compared to Whole Foods' 23. On valuation, Wal-Mart ends up the winner.

Dividends

Wal-Mart also has the more impressive record on the dividend front. In terms of current dividend yield, Wal-Mart has a lead of a full percentage point, weighing in at 2.8% compared to Whole Foods' 1.8%.

Wal-Mart has demonstrated a greater commitment to dividends and payout growth over its long history. For 44 straight years, Wal-Mart has increased the annual amount it pays in dividends to its shareholders, with its most recent 2% boost coming earlier this month. The pace of Wal-Mart's dividend increases has slowed in recent years, but the payout has still almost doubled since 2009.

By contrast, Whole Foods has been less reliable with its dividends. The company suspended payouts from mid-2008 to 2010, and increases have been relatively modest, including a $0.005 per share rise in January to $0.14 per share quarterly. Whole Foods simply hasn't been as clear as Wal-Mart has about its commitment to dividends and the importance they have to investors.

Growth prospects and risks

Both Wal-Mart and Whole Foods have struggled, but both are trying to bounce back. In its most recent quarter, Wal-Mart managed to post sales growth of 1%, even though net income fell by more than a sixth from year-ago levels. Comparable sales in its U.S. stores climbed 1.8%, with traffic growth accounting for most of the rise, and Wal-Mart's efforts to boost its online presence paid off with a 29% jump in e-commerce sales domestically. The retailer's guidance for the coming year was conservative, with expected revenue growth of 2% to 3% and more or less flat earnings per share compared to the just-completed fiscal year. Yet as Wal-Mart keeps aiming on the online retail space and works at managing its extensive inventory more effectively, investors hope that the retail giant will find ways to use its size and experience to woo shoppers both to its stores and to its mobile app and online portal.

Meanwhile, Whole Foods is still trying to figure out where the bottom of its recent downturn might be. In its most recent quarter, the grocer posted a 2% rise in revenue, but comparable-store sales dropped by 2.4% as traffic fell sharply. Whole Foods had to admit that it would see negative comps throughout the fiscal year, and it now thinks sales growth overall could be as little as 1.5%. The company is closing underperforming stores, and even though it's trying to refocus on its best customers, Whole Foods has conceded that it no longer believes that its store network will grow to the 1,200 mark that the company used to pursue. Early results from the 365 store concept, which features more attractive price points for certain shoppers, haven't proven to be the panacea that some investors had hoped to see. For investors, the future remains uncertain for Whole Foods, and more patience will be required to see where the store ends up.

Wal-Mart looks like the better buy right now on all fronts. With a more attractive dividend, cheaper valuation, and clearer growth prospects, Wal-Mart should retain an edge over Whole Foods until the natural and organic specialist figures out how to bounce back from its huge setbacks recently.

John Mackey, CEO of Whole Foods Market, is a member of The Motley Fool's board of directors. Dan Caplinger owns shares of Whole Foods Market. The Motley Fool owns shares of and recommends Whole Foods Market. The Motley Fool has a disclosure policy.