SAN FRANCISCO — Microsoft saw a surprise drop in sales and profit during the first three months of the year, in a sign the tech giant is still trying to find its way in the post-personal computer era.

Wall Street was expecting the company to show positive results from a series of changes that CEO Satya Nadella has been making. Instead, revenue for the January-March quarter fell 6 percent to $20.5 billion, while profit plunged 25 percent to $3.76 billion.

While sales of PCs have been sliding for the past four years, Nadella has been working to make Microsoft less dependent on revenue from its flagship Windows operating system, used mostly on PCs.

Microsoft said revenue from Windows software licenses declined 2 percent during the quarter, after adjusting for currency fluctuations. That’s better than the overall drop in PC shipments, which analysts at the Gartner research firm estimated at nearly 10 percent.

Revenue from business software and Internet-based services, known as cloud computing, didn’t grow as much as many analysts expected. In particular, Microsoft saw only a 3 percent increase in revenue from its “Intelligent Cloud” business, where the company has invested heavily to help business customers run their operations on Microsoft’s servers. The division’s operating profit fell by 14 percent.

In a few bright spots, the company said sales of its Surface tablet computers rose 56 percent to $1.1 billion, and revenue from ads shown with Bing search engine results grew 55 percent to $1.5 billion.

Microsoft said it earned 47 cents a share for the quarter, or 62 cents after adjusting for one-time charges. Analysts were expecting adjusted earnings of 64 cents a share.