Net revenue by region, monthly
Three regions moving in different directions: the crossover is the answer, and it is only visible once the daily orders are rolled up to months.
How it decided
Sales orders: 11,316 rows, 10 columns. order_date, region and net_amount answer this; the other six columns do not enter the chart.
11,316 rows in, 120 out across 3 columns. Three regions moving in different directions: the crossover is the answer, and it is only visible once the daily orders are rolled up to months.
line. Time on x and one line per region. Grouped bars would put twelve months side by side and hide the crossing.
Palette, spacing, axis titles and legend placement applied. 0 issues found.
The transformation
This is the code, not a description of it — the chart above was drawn from what it returns, and the notebook download runs the same lines against the same file.
df["month"] = df["order_date"].astype("datetime64[ns]").dt.to_period("M").dt.to_timestamp()
result = df.groupby(["month", "region"], as_index=False)["net_amount"].sum()
What it charted
120 rows out of 11,316, 3 columns. First 8 shown.
| month | region | net_amount |
|---|---|---|
| 2024-01-01 | APAC | 70764.68 |
| 2024-01-01 | Europe | 116188.98 |
| 2024-01-01 | LatAm | 23982.39 |
| 2024-01-01 | MEA | 23888.8 |
| 2024-01-01 | North America | 150740.81 |
| 2024-02-01 | APAC | 43801.73 |
| 2024-02-01 | Europe | 121428.58 |
| 2024-02-01 | LatAm | 43344.63 |