Top pharmacy retailer Walgreens Boots Alliance (WBA -3.08%) benefits from having a trusted brand that consumers feel comfortable working with. While it hasn't made for much of a growth stock over the years, the business generally produces consistent results, with annual revenue coming in at north of $130 billion in each of its past five fiscal years. The company is working to evolve its operations and has big plans to extend its business into basic healthcare, which may finally give investors a growth catalyst to rally around.

Given its improved growth prospects and a dividend that is currently yielding 6.1%, could Walgreens be a stock that helps get your portfolio to $1 million?

What needs to happen for Walgreens to be a millionaire-making investment

There are a few things that investors probably don't like about Walgreens' business today. The first is that it doesn't generate much growth. Although it's consistent in generating at least $130 billion in annual revenue, its top line hasn't exactly been strong the past few years.

Chart showing Walgreens' YOY revenue growth falling since 2022.

WBA Revenue (Annual YoY Growth) data by YCharts

Walgreens is, however, investing billions into primary care with its investment in VillageMD, where it plans to launch up to 1,000 clinics at Walgreens locations by 2027. By 2025, the company projects that its new U.S. healthcare business will bring in up to $16 billion in added annual revenue, which should finally give its top line a boost. It will need to continue to grow that area of its business for the stock to be successful and rise in value.

Another problem that the business needs to solve is profitability. The company doesn't generate strong margins, and that means it may even incur losses in the face of adversity.

Chart showing Walgreens' profit margin falling and rebounding in the last year.

WBA Profit Margin (Quarterly) data by YCharts

This won't be an easy problem to fix as the company doesn't project it will generate positive adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA) from its healthcare segment until 2024. Investors will need to be patient, as it could take even longer for that segment to be accretive to the bottom line. And that may not be a guarantee with Walmart also eyeing primary care as a potential growth opportunity.

If Walgreens succeeds on healthcare, the stock could be due for some massive gains

Shares of Walgreens are trading at just 7 times the company's estimated future earnings. That suggests investors really aren't bullish on the company's prospects. And the stock's short interest has also been rising over the years, which is clear evidence more people are betting on it to fail.

Chart showing Walgreens' percent of float short rising since 2020.

WBA Percent of Float Short data by YCharts

The elevated short interest could make Walgreens stock a potential candidate for a short squeeze in the future -- provided the company can generate strong results, including growing its healthcare segment and improving its margins.

Is all this likely to happen?

Walgreens should be able to grow its healthcare business given that the need for healthcare is going to rise, not fall, as the demographics shift and seniors account for more of the U.S. population. That part looks probable.

But the part that I'm not convinced about is the company's ability to improve its margins. More companies have shown an interest in primary care in recent years, including big tech, which could squeeze margins, making it less likely for Walgreens' new venture to be too profitable. And if the company can't strengthen its bottom line, its growth initiatives could even put its high-yielding dividend at risk. Should that happen, then the risk is that the stock could plummet further in value. Over the past 10 years, the stock's total return (which include its dividend) is negative 16%.

Should you buy Walgreens stock?

Walgreens could make for a compelling contrarian investment to buy. If it does well, there could be plenty of room for it to rise in value as it is trading near its 52-week low and is down 30% from its high. But I can't say with any confidence that this can be an investment that turns $25,000 into $1 million over the course of 20 years. I'm even doubtful whether a $100,000 investment would be sufficient to grow to $1 million over that time frame.

This is a bit of a risky stock to own given the uncertainty of Walgreens' expansion into healthcare and how that will turn out. It's possible it could be a millionaire-making investment, but based on how the company has been performing of late, it just doesn't seem probable at this point.