twoHelixestwoHelixes Start free

Datasets / Sales orders

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.

Question how did net revenue trend by region over time?
Net Amount over time0100k200k300kJan 24Mar 24May 24Jul 24Sep 24Nov 24Jan 25Mar 25May 25Jul 25Sep 25Nov 25MonthNorth AmericaEuropeAPACLatAmMEA
Sales orders — 120 rows charted from 11,316, drawn as a line
How it decided
Finding the data87 ms

Sales orders: 11,316 rows, 10 columns. order_date, region and net_amount answer this; the other six columns do not enter the chart.

Shaping the data41 ms

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.

Choosing the chart27 ms

line. Time on x and one line per region. Grouped bars would put twelve months side by side and hide the crossing.

Applying defaults1 ms

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.

monthregionnet_amount
2024-01-01APAC70764.68
2024-01-01Europe116188.98
2024-01-01LatAm23982.39
2024-01-01MEA23888.8
2024-01-01North America150740.81
2024-02-01APAC43801.73
2024-02-01Europe121428.58
2024-02-01LatAm43344.63