DDB

Updated on

DDB is a DAX function that returns the depreciation of an asset for a specified period using the double-declining balance method or another specified method.

Syntax

DDB(
   Cost,
   Salvage,
   Life,
   Period,
   Factor
)
Argument Properties Description
Cost The initial cost of the asset.
Salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).
Life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
Period The period for which you want to calculate the depreciation. Period must use the same units as life.
Factor Optional The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).

Return Values

The depreciation over the specified period.

Remarks

  • The double-declining balance method computes depreciation at an accelerated rate. Depreciation is highest in the first period and decreases in successive periods. DDB uses the following formula to calculate depreciation for a period:

    Min((costtotal depreciation from prior periods)×(factorlife),(costsalvagetotal depreciation from prior periods))

  • Change factor if you do not want to use the double-declining balance method.

  • Use the VDB function if you want to switch to the straight-line depreciation method when depreciation is greater than the declining balance calculation.

  • period is rounded to the nearest integer.

  • An error is returned if:

    • cost < 0.
    • salvage < 0.
    • life < 1.
    • period < 1 or period > life.
    • factor ≤ 0.
  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Examples

Example 1

The following DAX query:

EVALUATE
{
  DDB(1000000, 0, 10, 5, 1.5)
}

Returns an asset’s depreciation in the 5th year, assuming it will be worth $0 after 10 years. This calculation uses a factor of 1.5.

[Value]
78300.9375

Example 2

The following calculates the total depreciation of all assets in different years over their lifetimes. This calculation uses the default factor of 2 (the double-declining balance method).

DEFINE
VAR NumDepreciationPeriods = MAX(Asset[LifeTimeYears])
VAR DepreciationPeriods = GENERATESERIES(1, NumDepreciationPeriods)
EVALUATE
  ADDCOLUMNS (
  DepreciationPeriods,
  "Current Period Total Depreciation",
  SUMX (
    FILTER (
      Asset,
      [Value] <= [LifetimeYears]
    ),
    DDB([InitialCost], [SalvageValue], [LifetimeYears], [Value])
  )
)

Other functions related to DDB are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/ddb-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy