Skip to content

How to calculate days sales outstanding (DSO), with examples

Days sales outstanding is how many days, on average, your customers take to pay. The formula with a worked example, the countback method for uneven sales, what a good DSO is, the mistakes that hide slow payers, and DAX, SQL and Excel to copy.

Short answer: DSO = accounts receivable ÷ credit sales in the period × days in the period. With €84,000 still owed at the end of June and €60,000 of credit sales in June, DSO is 84,000 ÷ 60,000 × 30 = 42 days: on average, a sale turns into cash six weeks after it is made.

Sales can grow while the bank account shrinks. The usual reason is that customers pay later than they should, and the money you have earned sits in receivables where you cannot use it. DSO turns that into one number you can watch every month and compare with your payment terms.

This post covers the formula, two ways to read receivables, the countback method, benchmarks, and a measure for Power BI, a SQL query and an Excel formula.

What is the DSO formula?

DSO = Accounts receivable ÷ Credit sales in the period × Days in the period
PartWhat goes inWhere it comes from
Accounts receivableWhat customers owe you at the end of the periodThe balance sheet or the receivables ledger
Credit salesSales made on invoice in the same period, without cash or card salesSales or the income statement
Days in the period30 for June, 90 to 92 for a quarter, 365 for a yearThe calendar

The period can be a month, a quarter or a year, as long as all three parts cover the same one. Monthly shows a change while there is still time to act on it.

How do you calculate DSO, step by step?

Take June, with net 30 payment terms:

FigureValue
Receivables on 30 June€84,000
Credit sales in June€60,000
Days in June30

84,000 ÷ 60,000 = 1.4, and 1.4 × 30 = 42 days. With 30-day terms, customers take roughly 12 days longer than you allow.

Ending or average receivables?

Both are in use. Some write the formula with the balance at the end of the period; others take the average of the opening and closing balance, to smooth out a single day. With €72,000 owed on 1 June, the average is (72,000 + 84,000) ÷ 2 = €78,000, and DSO is 78,000 ÷ 60,000 × 30 = 39 days.

Neither is wrong. Pick one, write it next to the chart, and never compare a number from one with a number from the other.

What is the countback method, and when is it better?

The simple formula assumes sales arrive evenly through the period. When they do not (a strong month, a season, one big order), the countback method gives a truer figure. You start from the receivables at the end of the period and subtract each month's credit sales, newest first, until the balance is used up. The days you used are the DSO.

Receivables on 31 March are €180,000:

MonthCredit salesReceivables leftDays counted
March (31 days)€120,000€60,00031
February (28 days)€90,000€0 (€60,000 of €90,000 used)60 ÷ 90 × 28 = 18.7
DSO49.7 days

The same data gives 46.5 days with March alone (180,000 ÷ 120,000 × 31) and 52.3 days with the quarter (180,000 ÷ 310,000 × 90). The countback answer follows the sales the receivables actually come from, which is why it is preferred when sales are uneven.

What is a good DSO?

Compare it with your own payment terms first: a DSO well above them means slow collection. For net 30, anything above 40 to 45 days is worth a look.

As a broad reference, APQC's figures (quoted by Corpay, June 2024) put top performers at 30 days or less, the median at 38 days or less and the bottom quarter at 46 days or more. Industry matters: shops and restaurants paid by card sit close to zero, while construction, manufacturing and enterprise software can run 60 days or more.

The direction matters more than one month's value: a DSO that creeps up three months in a row is a problem even when it is still under your target.

What makes DSO look better or worse than it is?

  • Total sales instead of credit sales. Cash and card sales never become receivables, so adding them makes DSO look lower than the real wait for your money. It is the most common error.
  • A big sale at the end of the month. It raises receivables, and DSO with them, without any collection problem. Check the countback figure or the aging before you chase anyone.
  • Write-offs. Writing off a debt you will never collect lowers receivables and DSO. Nothing was collected; the number only looks better.
  • Mixed definitions. Ending in one month, average in the next, or a 30-day month for every month. Keep one definition and the real number of days.

How do you calculate DSO in Power BI with DAX?

The measure, as KPI Atlas gives it:

DSO = DIVIDE ( [Accounts Receivable], [Credit Sales] ) * COUNTROWS ( 'Date' )

COUNTROWS ( 'Date' ) counts the days in the period on the visual, so it needs a date table with one row per day. Receivables are a balance, not a flow: never sum them over the month. Take the closing balance instead, and filter sales to credit sales. With your own table and column names:

Accounts Receivable = CLOSINGBALANCEMONTH ( SUM ( Receivables[Balance] ), 'Date'[Date] )
Credit Sales = CALCULATE ( SUM ( Sales[Amount] ), Sales[PaymentType] = "Credit" )

How do you calculate DSO in SQL and Excel?

In SQL, from a table with one row per month:

SELECT month, receivables / NULLIF(credit_sales, 0) * days_in_month AS dso FROM monthly_ar;

NULLIF keeps a month without credit sales from dividing by zero. If the columns are integers, write receivables * 1.0 so the database does not drop the decimals.

In Excel, with the three figures in named cells:

=AR / CreditSales * DaysInPeriod

For the days in a month, =DAY(EOMONTH(A2,0)) returns 30 for any date in June.

How should you show DSO?

A line chart of monthly DSO with your payment terms as a second line shows the trend and the gap at once. A bar chart by customer or region shows who pays late. A stacked bar of receivables by age (current, 30, 60 and 90+ days) shows how old the money owed is, which DSO alone cannot.

Read it with the KPIs around it: days payable outstanding (how long you take to pay suppliers), the cash conversion cycle (days inventory outstanding + DSO − days payable outstanding), the collection effectiveness index (how much of what could be collected was) and receivables over 90 days (where bad debt comes from).

Where can you check this?

Where do you find DSO and the KPIs around it?

KPI Atlas has days sales outstanding with its formula, the DAX, SQL and Excel to copy, a benchmark, the mistakes to avoid and its best charts drawn, next to days payable outstanding, the cash conversion cycle, the collection effectiveness index and receivables over 90 days. It holds 455 KPIs for 30 areas of a business, so the rest of a finance dashboard is one search away.

The tool

Do it in your browser.

Data

KPI Atlas

455 KPIs for 30 areas of a business, each with its definition, formula, DAX, SQL and Excel, a benchmark, the mistakes to avoid, and the charts that show it best, drawn.

Keep reading

More from the blog.

Every post

Contact