Cost to Serve

Calculates average customer support cost per customer using P&L data and customer counts.

Purpose

Provide a cost-to-serve view at the customer level, translating customer support expenses into an average cost to serve per customer.

This model is designed as an efficiency and unit-economics reporting layer, enabling:

  • Monitoring customer support cost scalability
  • Comparison of cost-to-serve across periods

It connects operational cost data with customer scale.

Business Logic

  • Start from PnL Rollup
  • Filter to customer support–related costs (gl_id = 4030)
  • Join with Customer Count View
  • Divide total support cost by ending customer count
  • Default missing or zero-customer cases to 0
  • Produce one row per date and value type

Output Contract

Definitions

ColumnDescription
dateDate of the cost snapshot (YYYY-MM-DD)
value_typeValue type such as actual, budget
customer_support_costTotal customer support cost for the period
nr_of_customersNumber of active customers at period end
cost_to_serveAverage customer support cost per customer

Sample & Implementation

Customer support cost per customer by period and value type.
datevalue_typecustomer_support_costnr_of_customerscost_to_serve
2025-01-01budget15717.030355.1786
2025-02-01budget15717.030825.0996
2025-03-01budget15717.031295.023
2025-04-01budget15717.031764.9487
2025-05-01budget15717.032234.8765
2025-06-01budget15717.032704.8064
2025-07-01budget15717.033164.7397
2025-08-01budget15717.033624.6749
2025-09-01budget15717.034084.6118
2025-10-01budget15717.034544.5504
{{config(materialized='view')}}


with pnl_rollup as (
    select * from {{ ref('pnl_rollup') }}
),

customer_count_view as (
    select * from {{ref('customer_count_view')}}
),

customer_support_costs as (
    select
        date,
        gl_id,
        gl_account,
        value_type,
        amount
    from pnl_rollup
    where gl_id = 4030
)

select
    css.date,
    css.value_type,
    css.amount as customer_support_cost,
    ccv.ending_balance as nr_of_customers,
    COALESCE(css.amount / ccv.ending_balance,0) as cost_to_serve
from customer_support_costs css
left join customer_count_view ccv on css.date = ccv.date and css.value_type = ccv.value_type

Dependencies

On this page

Star us on GitHub

If you enjoy this content and find it useful, give us a star on GitHub to show your support and stay updated with our latest improvements.