Shares of Microsoft (MSFT -0.20%) are up 18% this year (returns as of June 27), and that has pushed the stock to a new all-time high. It's been a traditionally safe stock to own, but it's definitely expensive these days, trading at around 38 times its trailing earnings.
The business has many growth opportunities and has been a big player in artificial intelligence (AI), which has investors bullish on its long-term future. But given its high valuation, should you consider waiting for a dip in price before adding the stock to your portfolio?

Image source: Getty Images.
Microsoft's stock is trading at a higher earnings multiple than its 10-year average
Entering trading this week, Microsoft's valuation was at record levels, with a market cap of $3.7 trillion. It's one of the most highly valued stocks on the market today, trailing only Nvidia. But market cap alone doesn't tell investors if a stock is overpriced or not.
Looking at a stock's price-to-earnings (P/E) multiple can be an effective way to gauge its relative value. You can compare it to other stocks or even look at its historical average. And based on its 10-year average P/E, Microsoft does indeed look like an expensive stock right now.
MSFT PE Ratio data by YCharts
The stock doesn't look wildly expensive based on the above figure, but investors do appear to be paying a higher premium for the business these days. A higher P/E multiple can be justifiable if a business is performing particularly well and growing at a higher rate than normal, or if it has a big growth catalyst -- such as AI.
Microsoft's growth rate has been higher than normal
In recent years, Microsoft has expanded through its acquisition of video gaming company Activision-Blizzard and its heavy investments in AI. Currently, its AI business is generating revenue at an annual run rate of $13 billion, which is a modest amount for a tech company whose sales over the trailing 12 months have totaled $270 billion.
MSFT Operating Revenue (Quarterly YoY Growth) data by YCharts
There's still potentially much more growth ahead if demand for AI-powered PCs picks up. Unfortunately, with consumers scaling back on spending amid turbulent economic conditions, it may take some time before that may have any sizable impact on its operations.
Should you buy Microsoft stock today?
Microsoft is a good long-term investment, but I wouldn't buy it today. At such a high valuation, I don't think it's generating nearly enough growth to justify such a high premium, especially when there are many cheaper AI stocks to choose from; there's not nearly a compelling enough reason to invest in Microsoft right now.
I'd put the stock on a watch list, but I wouldn't buy it at its current valuation. There's not much margin of safety and if there's a slowdown in tech spending, especially if companies worry about an economic downturn, then there could be considerable room for the stock to fall.