Microsoft reports earnings that fall short of already-reduced expectations.

SEATTLE — The uncertainty and challenges in the global economy have hit Microsoft, which on Tuesday reported quarterly earnings that fell short of Wall Street’s and its own expectations.

The tech giant said it had $51.9 billion in sales in the quarter ended June 30, up 12 percent from a year earlier. Profit rose 2 percent to $16.7 billion.

The results missed even Microsoft’s own reduced expectations. In early June, the company lowered its guidance for the quarter to account for the increasingly strong U.S. dollar.

“We’re obviously incredibly bullish on just about everything else that we have,” Chris Capossela, the company’s marketing chief, said after the revised guidance was released. “That’s one thing we can’t control.”

Since then, the conditions appear to have deteriorated further. The foreign currency challenges spurred by the war in Ukraine and broader economic uncertainty cost Microsoft $595 million in the quarter as it converted sales in Europe, Japan and elsewhere back into U.S. dollars. And production slowdowns of personal computers in China and falling consumer demand caused a decline of more than $300 million in sales of its Windows operating system that comes preinstalled on new computers.

A slowdown in advertising spending on LinkedIn and on Microsoft’s search products caused more than a $100 million decline in revenue.

Were it not for currency problems, Microsoft’s flagship cloud computing platform, Azure, would have grown 46 percent. Instead, it grew 40 percent, short of what investors expected.

The overall revenue for Microsoft’s commercial cloud computing offerings, which also includes Office 365 subscriptions, increased 28 percent to $25 billion.

“We see real opportunity to help every customer in every industry use digital technology to overcome today’s challenges and emerge stronger,” Satya Nadella, the company’s chief executive, said in a statement

Microsoft’s personal computing business grew 2 percent to $14.4 billion, dragged down by the 2 percent decline in sales of its Windows operating system that comes preinstalled on personal computers. Investors were prepared to see some weakness because shipments of PCs are down from weakened demand and supply chain problems brought on by coronavirus lockdowns in China.

Revenue from Xbox content and services fell 6 percent.

With unemployment remaining near the lowest levels in 50 years, LinkedIn, the professional social network Microsoft bought in 2016, grew 26 percent, down from 34 percent growth the previous quarter.