2023 has proven to be another dynamic year for the market. Early on, many pundits were sure in their predictions of a recession, but it never materialized. In fact, gross domestic product grew 5% last quarter, surprising many.

But make no mistake, this is a challenging economy. Interest rates are high, and consumers are stretched (credit card debt is at an all-time high!). Alphabet's stock price plummeted after its third-quarter earnings release in late October, and this made me a little edgy waiting on Amazon's (AMZN -0.63%) Q3 results, which came out a few days later. Instead, Amazon turned the tide (See chart below. The "E" indicates earnings releases on the charts).

AMZN Chart

AMZN data by YCharts

Let's look at three key performance indicators (KPIs) from Amazon that stood out as making a difference.

1. Advertising is growing again

Amazon's advertising growth has been a revelation. The segment has produced $44 billion in revenue in the trailing 12 months, 8% of Amazon's total sales. The segment has grown 350% since 2019, when it produced just $12.6 billion in sales, including 26% year-over-year growth in Q3. I have been on the Amazon advertising bandwagon, despite the advertising slowdown in the broader economy, because Amazon's solutions (like product placement) are attractive in this market. Advertisers know they are reaching an audience actively shopping for their product, making it an efficient way to market.

2. More sales are high-margin

Amazon Web Services (AWS) grew sales by 12% year over year in the quarter. This might not seem like much compared to recent years, but the slight increase in the growth rate from the second quarter could indicate that sales growth is set to accelerate again. As shown below, Amazon continued to improve its sales mix, getting more sales from higher-margin services than retail.

Amazon sales by revenue stream

Data source: Amazon. Chart by the author.

This trend is one reason Amazon's trailing-12-month operating income bounced back to $26.4 billion in Q3 (up 103%).

3. Free cash flow is back!

Amazon spent a boatload of cash on property and equipment (capital expenditures) in 2021 and 2022 -- $125 billion vs. $57 billion in 2019 and 2020. This allowed the company to build out its logistics operations and capacity for AWS, but it took a considerable chunk out of free cash flow (FCF). This was exacerbated by a difficult economic environment in 2022, and Amazon's FCF was well under water.

These investments are paying off now. As depicted below, FCF is recovering in a big way.

AMZN Free Cash Flow Chart

AMZN Free Cash Flow data by YCharts

Is Amazon stock a good buy now?

Amazon stock is still undervalued historically despite recent gains. The price-to-earnings (P/E) ratio has never been a good measurement for Amazon stock because generally accepted accounting principles (GAAP) profits are inconsistent. Instead, I look at the price-to-sales (P/S) and cash-flow ratios, as shown below.

AMZN PS Ratio Chart

AMZN PS Ratio data by YCharts

Based on these measures, Amazon stock still trades at a discount to its five-year averages. Of course, no stock is without risk. Many economists are still predicting a recession in 2024, which would be a significant headwind. On the other hand, Amazon is set to benefit from companies rushing to capitalize on artificial intelligence (AI). AI has massive data needs, which will be bullish for AWS for years. All in all, Amazon's Q3 is a bullish sign for the future.