To afford a dividend, companies must make consistent profits, preferably via a business model that won't need to change significantly over time. That means they're often priced at a premium because investors love consistency, as they well should.

But sometimes, a window of opportunity opens to load up on certain dividend stocks before their valuations get bloated, as they tend to do during a bull market. Here are two such stocks with that window still wide open, even if it might not be for much longer.

1. Viatris

If you want to capture the juicy forward dividend yield of above 4% from holding shares of Viatris (VTRS), it'll behoove you to invest soon. The company's portfolio of generic medicines is always expanding. It's currently waiting on regulatory approval to commercialize at least 10 new generics for complex injectable drugs, which could add more than $1 billion in sales to its top line before 2027. Given that its trailing-12-month (TTM) sales are $16.7 billion and that it has a smorgasbord of other approvals in the pipeline, anticipated to generate at least another $2 billion in annual revenue by 2028, its shares are likely to rise in the coming years.

But don't take that to mean it's priced like a growth stock. On the contrary, Viatris' shares are going for a price-to-book (P/B) multiple of 0.74. That means the stock's valuation is currently lower than the value of the business' assets in liquidation. So even if it goes bankrupt tomorrow and needs to sell off everything it has -- which it won't need to do -- shareholders would get their money back, at least in theory.

In practice, this steep bargain won't last long, especially not in a new bull market. During bull markets, valuations tend to rise, and Viatris is unlikely to be an exception, given that it's profitable and slated to tack on more revenue each year. Plus, management plans to keep returning capital to shareholders throughout 2023 and beyond, and hikes to the dividend payment and more share repurchases are probable. While investors shouldn't expect the company to beat the market, as making generics isn't exactly a hot business, it's still a decent option for generating dividend income at a cheap price.

2. NextEra Energy Partners

The story of the next bull market may well be a tale of green energy stocks soaring in response to government subsidies, the falling cost of renewables, and the phasing out of fossil fuels. If that happens, companies like NextEra Energy Partners (NEP) will be among the most appealing to hold, as its strategy of buying and operating long-lived, green-energy-producing assets like wind turbine farms and photovoltaic solar panel fields will undoubtedly pay off big. And with a bottom line of $477 million in 2022, few operators are larger or more profitable than NEP.

At the moment, its forward dividend yield is near 4.5%, but that belies its history of hiking its payout. Over the past five years, its dividend grew by 93.4%. And management is confident it'll continue to hike it at a rate of between 12% and 15% annually through at least 2026.

To keep growing, the business needs to use its capital to buy more energy-generating assets, then recoup the costs of the purchases by operating them efficiently for years. Given that it has $235 million in cash on hand and $2.5 billion in borrowing capacity via its revolving credit facility, new acquisitions shouldn't be a problem. And with a wide profit margin of 39.3%, it's clear that NEP understands how to make a buck by managing renewable energy resources.

So it makes sense to accumulate some shares before the next bull market. After all, when prices rise, dividend yields fall, and there's little to suggest that this stock will be on sale for anything cheaper than its current valuation anytime soon.