1

Stripe – average revenue by plan

Question

What is the annual revenue you are generating by plan?

Sources

Stripe (full schema here)

Results

Query

select
date_trunc('month', charges.created),
plans.name plan,
count(distinct charges.customer_id)
num_customers,
sum(charges.amount) / 100 total_revenue
from stripe.subscriptions subscriptions
join stripe.plans plans
 on subscriptions.plan_id = plans.id
join stripe.charges charges
 on subscriptions.customer_id = charges.customer_id
where charges.captured is true
 and amount_refunded = 0
group by date_trunc('month', charges.created), plans.name
order by date_trunc('month', charges.created) desc, plans.name