It's been a transformative fiscal 2018 for financial powerhouse Macquarie Group: in the space of a few months it has appointed its first female chief executive and boosted its competitive advantage enough to become the newest member of Morningstar’s "moat" club.

And despite intense competition from global dairy producers, effective brand positioning in the Chinese infant formula market and Australian fresh milk arena has been enough to warrant a "narrow" moat rating for powerhouse dairy play a2 Milk.

a2Milk moat stock

a2 Milk is available for roughly double the price of the store-brand equivalents

As the metaphor made famous by Warren Buffett suggests, gaining an economic moat means building a sustainable competitive advantage — qualities that allow a company to fend off competition and earn high returns on capital.

A key distinguishing feature of a moat-rated company is its ability to evolve in the face of changing business conditions and new or existing competitors.

We've used Morningstar's Stock Screener to identify two companies which have built narrow economic moats - but also possess an analyst rating of four (accumulate) or five (buy) stars.

This means they're meaningfully undervalued and likely or highly likely to appreciate beyond a fair risk-adjusted return over several years.

A2 Milk unfazed by new Chinese e-commerce laws

Licensor and marketer of fresh milk and infant formula a2 Milk Co (ASX: A2M) has been a share market darling for the past two years and it's easy to see why.

Consumers have flocked to a2 Milk because of this perceived health benefit, with the firm expanding market share in Australian fresh milk, as well as infant formula in both Australia and China.

A2 Platinum infant formula has climbed to 32 per cent value share in Australia from the low 20 per cent range only a few years ago, per company estimates. Similarly, A2 fresh milk has seen its share of the Australian market increase to nearly 10 per cent, from about 7 per cent in fiscal 2013.

These gains have come despite A2's generally premium pricing, suggesting consumers are willing to pay up for the brand. In Australian fresh milk, a2 Milk is available for roughly double the price of the store-brand equivalent.

All this has led Morningstar director of equity research Adam Fleck to apply a narrow economic moat to the stock upon his commencement of coverage in September, based on strong intangible assets including brand and patent protection.

"The company's products have become synonymous with the A1-protein-free dairy category and have gained market share as the perceived health benefits of the offering have increased among its target consumer base," Fleck says.

A2's results so far this fiscal year highlight its continued success. The company lifted net profit by 64.5 per cent to $NZ86 million ($80.62 million) between July and October 2018 while revenues rose 40.5 per cent to $NZ368.4 million.

But there are risks. New laws due to apply from 1 January 2019 will usher in changes to Chinese e-commerce regulations - aiming to further protect consumers by regulating and holding responsible product sellers for the authenticity of their goods and cracking down on the lack of consistent tax collection for personal shoppers importing formula into the country.

As a result, Morningstar sees risks to a2's daigou-related, individual-shopping and import business, which represents about 65 per cent of the company's revenue in China.

Fleck acknowledges that a2 could see short-term disruption. Concerns over the changes have driven the stock's price nearly 20 per cent over the past three months. But he remains confident in the company's ability to handle the change.

"At the company’s annual general meeting, a2's management reiterated its view that it has managed its daigou network effectively to prepare for these changes," he says.

"In all, if our assumptions on this matter hold, we see limited long-term impact for a2's brand or growth prospects. Should new regulations create short-term volatility, we expect a2 is well-prepared to navigate through the noise, and potentially even capture greater market share should the market consolidate further."

In October, Morningstar elevated a2 to its list of global equity best ideas, citing the opportunities for growth in China, and setting a fair value estimate of $12.90. A2M closed yesterday at $10.40.

Macquarie: new kid on the moat block

In July last year, Macquarie Group (ASX: MGQ) made headlines by announcing low-profile company stalwart Shemara Wikramanayake as successor to long-time chief executive Nicholas Moore.

The move was universally hailed as a shrewd business move and a win for diversity as Wikramanayake, 56, born to a Sri-Lankan doctor, became only the second woman to head up a financial institution in Australian.

But even in the months leading up to the historic move, Morningstar banking analyst David Ellis had seen a rise in Macquarie’s trajectory, leading him to raise the company’s moat rating from "none" to "narrow" in April this year.

"We reassess the competitive strengths of Macquarie Group’s five business units and conclude the group does benefit from competitive advantages that are sufficiently strong to warrant upgrading the economic moat rating to narrow from no moat," Ellis said in a note to herald the move.

In Ellis's reckoning, the group benefits from competitive advantages across its five businesses – asset management, corporate and asset finance, banking and financial services, commodities and global markets, and Macquarie capital.

Ellis says the group's strong first-half fiscal 2019 performance continues to demonstrate the strength of its diversified, yet interconnected business units.

"Macquarie's two market-facing business (Macquarie Capital and Commodities and Global Markets) are benefiting handsomely from stronger capital markets activity and confidence complementing a slightly softer performance from the three non-market-facing businesses," he wrote in a November research note.

"Following our post result management catch up, we are more convinced the global leader in infrastructure asset management and renewable energy is well placed to generate impressive earnings growth."

Based on the stronger earnings outlook, Ellis has increased the group's fair value estimate 4 per cent to $135 per share. MQG closed trading yesterday at $106.85.