Wal-Mart Stores (WMT 1.32%) has been a staple holding in Warren Buffett's Berkshire Hathaway (NYSE: BRK-B) (NYSE: BRK-A) portfolio for years, but the Oracle of Omaha has soured on Wal-Mart's stock this year, and a new report from the U.S. Census Bureau showing that consumers continue to embrace e-commerce may mean there's a good chance that Wal-Mart is completely out of Berkshire's portfolio by the end of this year. 

What's up?

Wal-Mart may be a retail store Goliath, but it's far from the biggest online retailer, and that's a big problem for the company's future growth.

Wal-Mart's sales barely budged in the third quarter, increasing by a only a modest 0.5% from the third quarter of 2015. Meanwhile, consumers ongoing shift to online shopping propelled sales at online giant Amazon.com (AMZN -1.64%) 29% higher when compared to a year ago.

Man with a suit holding a sign that says "TIME TO SELL."

Image source: Getty Images.

According to the Census Bureau, that trend away from retail stores to online stores isn't losing steam. In Q3, U.S. retail e-commerce sales, adjusted for seasonal variation but not for price changes, grew 4% quarter over quarter to $101.3 billion. That handily outpaced the 0.9% quarter-over-quarter increase in total retail sales in the period, but the gap between the two is even wider when considering the year-over-year change. Compared to Q3 2015, adjusted e-commerce sales grew 15.7% last quarter, while total retail sales only grew 2.2%.

Overall, the rapid growth in online purchases has led to e-commerce sales now accounting for 8.4% of total sales, up from 7.4% of sales a year ago.

Growth in online shopping has been a boon to Wal-Mart competitors, especially Amazon. Online retailers have more inventory and marketing flexibility, and they also have cost advantages that help them compete better for wallet share. Trailing-12-month SG&A as a percentage of sales is more than 1% lower at Amazon than it is at Wal-Mart, and Amazon's gross profit margin is nearly 10% better than Wal-Mart's.

AMZN Gross Profit Margin (TTM) Chart

AMZN gross profit margin (TTM) data by YCharts.

Given that it's most likely that more consumer spending will migrate away from traditional stores to the internet, it's little wonder that investors like Buffett might be worrying more about Wal-Mart's future sales and profit headwinds.

A tough competitor

Earlier this year, Buffett praised Amazon founder Jeff Bezos, calling him a "genius." And at Berkshire Hathaway's annual investor event in Omaha, Buffett remarked, "We're not going to out-Bezos Bezos."

In the past, Buffett was slow to embrace the use of the internet to boost sales at Berkshire Hathaway's wholly owned companies. However, that's recently been changing, and as he sees the sales tailwinds at his companies from his online initiatives, it may be factoring into his increasing admiration of Bezos, and his declining interest in owning bricks-and-mortar companies like Wal-Mart.

It's probably not lost on Buffett that Amazon has been a much better investment than Wal-Mart over the years, either. Under Bezos' leadership, Amazon's trailing-12-month revenue has surged to $128 billion since 1994, and that's resulted in astonishing returns for long-term investors. Over the past 15 years, Amazon's 34%-per-year average return crushes the average 12.9% return for the specialty retail industry, and it absolutely demolishes Wal-Mart's 3.2% annual return over the period.

Since Bezos doesn't appear ready to quit anytime soon, and e-commerce still represents less than 10% of total retail spending, it seems Wal-Mart's going to have its hands full for a long time if its going to attempt to keep Amazon at bay.

Looking forward

Buffett's sold tens of millions of shares in Wal-Mart this year, but he still has 12.9 million shares left in Berkshire Hathaway's portfolio. With Wal-Mart shares up 19% this year, he appears to see this as a great opportunity to "sell high" a business that could face increasingly more downside profit pressure in the coming years.

Whether Buffett does sell his remaining Wal-Mart shares this year won't be known until early next year, when Berkshire Hathaway files its fourth-quarter 13F report with the Securities and Exchange Commission. But given his admiration for Bezos and his selling of 27.2 million Wal-Mart shares last quarter, I will not be surprised if Wal-Mart disappears from Berkshire's list of holdings.