Metric

What is days sales outstanding (DSO)?

Definition

Days sales outstanding estimates how many days of credit sales remain tied up in accounts receivable. It is useful as a trend and segment comparison, but seasonality and revenue mix can distort a single-period value.

Formula: DSO = average accounts receivable / credit sales in period x number of days in period

What data do you need?

  • Beginning and ending AR, or daily AR snapshots
  • Credit sales for the same period and scope
  • Fiscal calendar and day count
  • Entity, customer segment, and currency dimensions
  • Consistent treatment of taxes, credits, and intercompany revenue

SQL pattern

Monthly DSO using average daily ARPostgreSQL
WITH ar AS (
  SELECT
    date_trunc('month', as_of_date) AS month,
    AVG(total_open_ar) AS average_ar
  FROM daily_ar_balance
  GROUP BY 1
), sales AS (
  SELECT
    date_trunc('month', invoice_date) AS month,
    SUM(credit_sales_amount) AS credit_sales
  FROM modeled_invoices
  GROUP BY 1
)
SELECT
  ar.month,
  ar.average_ar / NULLIF(sales.credit_sales, 0)
    * EXTRACT(day FROM (ar.month + INTERVAL '1 month - 1 day')) AS dso
FROM ar
JOIN sales USING (month)
ORDER BY ar.month;

Common pitfalls

Using total revenue when cash sales are material.→ Use credit sales or state that total revenue is a proxy.
Comparing quarter DSO with month DSO without day adjustment.→ Use the actual number of days in the measurement period.
Using ending AR in a seasonal business.→ Prefer average daily or beginning-and-ending AR and show cohort collection metrics alongside DSO.

Where does this metric apply?

This metric commonly uses data from NetSuite, Xero, FreshBooks, QuickBooks, SAP, plus any reconciled warehouse or ledger models that provide the same business grain.

Dashboards

Integrations

Metrics

Analytics

FAQ

Is lower DSO always better?
Usually it indicates faster collection, but changes in customer mix, terms, and revenue timing need context.
Can DSO be negative?
It can occur with customer prepayments or net credit balances; investigate the AR scope and present prepayments separately.