Walgreens Boots Alliance (WBA -2.20%) is a big, trusted, pharmacy retailer that most consumers have likely visited at some point. But as an investment, it has been underwhelming, to say the least. Its shares have plummeted 50% over the past five years -- and for investors, buying the dip simply hasn't paid off. Could the next five years be any better for the stock?

Expect a more diverse business

Walgreens has been expanding its business so that it's more than just a pharmacy retailer and a bigger healthcare business overall. While customers are at their local Walgreens to fill prescriptions, they may also buy groceries and personal care products. But Walgreens wants to give consumers a reason to go more often and potentially spend even more money. One way to do that is by offering healthcare services.

Close to 80% of Americans live within five miles of a Walgreens or Duane Reade store (which Walgreens owns). Convenience is a big advantage for Walgreens, and it's hoping that healthcare services will be a further incentive for people to visit the stores. COVID vaccinations brought in more foot traffic to Walgreens' stores, and that resulted in some stellar numbers for the company. Expanding into healthcare may have the same effect.

In 2021, the company announced a $5.2 billion investment into primary care operator VillageMD. The goal is to have 1,000 co-located primary care practices by 2027. Walgreens anticipates that its new U.S. healthcare business will generate up to $16 billion in revenue by 2025, and five years from now that revenue should be even greater.

Walgreens typically makes more than $130 billion in revenue each year. So the healthcare business won't dramatically change its operations, but at around 11% of the top line, it would add some diversification and potentially open up some new growth opportunities for the business. And one of the struggles for Walgreens' investors in the past has been that the company hasn't generated much growth:

WBA Revenue (Annual YoY Growth) Chart

WBA Revenue (Annual YoY Growth) data by YCharts

Profitability should also improve

It could take a while for Walgreens' U.S. healthcare business to become profitable. Last year, the company said that it expects the new segment to be profitable on an adjusted earnings before interest, taxes, depreciation and amortization (EBITDA) basis by fiscal 2024 (the company's year ends in August). If that trajectory continues, then five years from now the bottom line should be even stronger.

Plus, the company has also been deploying a transformational cost management program aimed at bringing down expenses and saving the company up to $3.5 billion in annualized costs, also by fiscal 2024. One of the downsides with Walgreens is that the business' margins aren't great, and so there often isn't much of a buffer if the company incurs an unexpected expense.

This year, opioid-related lawsuits and legal costs have resulted in the company's bottom line falling into the red.

WBA Profit Margin Chart

WBA Profit Margin data by YCharts

So where will Walgreens be five years from now?

Walgreens' stock is trading at just six times its trailing earnings. Investors have more than a little skepticism when it comes to the business, and for good reason -- its track record hasn't been great. The healthcare strategy could be what makes or breaks the business and the underlying stock's returns in the future.

I'm optimistic that, with Walgreens leveraging its trusted brand to lean into healthcare, it can be successful. And with a relatively low valuation right now, this could be a good buy and produce much better returns for investors over the next five years.

It isn't, however, a risk-free investment, as CVS HealthWalmart, and even Amazon have been showing a greater interest in primary care in recent years. Walgreens could face some intense competition, and it may not be an easy road ahead for the company.