Microsoft's market value ticked over the US$3 trillion mark this week. 

The rise of Microsoft's shares this week to a record peak of US$405.63, an increase of 1.7 per cent, momentarily propelled the company beyond the coveted US$3 trillion threshold. 

However, the closing figure settled slightly lower at $402.56, placing its valuation at a mere US $2.99 trillion. 

Microsoft still trails behind the world’s largest single company by market value, Apple. Apple saw a minor dip this week, with shares declining by 0.35 per cent to close at US$194.50. However, it still managed to maintain its US$3 trillion market cap.

Central to Microsoft's recent success is its strategic investment in OpenAI, the creators of ChatGPT, positioning the company at the forefront of the burgeoning generative artificial intelligence (AI) sector. 

This move has enabled Microsoft to enhance its core productivity software and the Bing search engine, setting the stage for a stronger competition with Google's search services.

Contrastingly, Apple faces challenges, particularly in China, where slowing iPhone demand has led the company to offer uncommon discounts in an effort to bolster sales amidst fierce competition from local manufacturers like Huawei Technologies.

Analysts attribute Microsoft's ascendancy to the growing enthusiasm for AI technology, and Apple's lack of a comparable AI narrative amidst iPhone sales concerns.

With a bullish outlook from analysts, who have raised Microsoft's median stock price target to US$425, the company's shares have witnessed a nearly 57 per cent surge in 2023, with an additional 7 per cent increase this year. 

Apple saw a more modest 1 per cent growth year-to-date.