DAXFinancial Flashcards
LINEST(‘Sales’, [XValues], [YValues], TRUE)
This DAX code uses the ‘LINEST’ function to calculate the least squares regression line that best fits the data in the ‘Sales’ table, where ‘XValues’ and ‘YValues’ are the input data columns. The ‘TRUE’ parameter forces the intercept to be zero.
LINESTX(‘Sales’, [XValues], [YValues], TRUE)
Similar to ‘LINEST’, this DAX code uses the ‘LINESTX’ function to calculate the least squares regression line for the ‘Sales’ table, but it operates on expressions evaluated for each row in the table, rather than specific columns. The ‘TRUE’ parameter still forces the intercept to be zero.
ACCRINT(“01/01/2023”, “06/30/2023”, “07/01/2022”, 0.05, 1000, 2, 0)
The ACCRINT function calculates the accrued interest for a security that pays periodic interest. In this example, it calculates the accrued interest for a security with a principal amount of $1,000, a 5% annual interest rate, and a semi-annual payment frequency, between January 1, 2023, and June 30, 2023, with the settlement date on July 1, 2022.
ACCRINTM(“01/01/2023”, “07/01/2022”, 0.05, 1000)
The ACCRINTM function calculates the accrued interest for a security that pays interest at maturity. In this example, it calculates the accrued interest for a security with a principal amount of $1,000, a 5% annual interest rate, and a settlement date of July 1, 2022, with the maturity date on January 1, 2023.
AMORDEGRC(120, 1, “01/01/2022”, “12/31/2022”, 0.1, 6)
The AMORDEGRC function calculates the depreciation for each accounting period using a declining balance method with a coefficient applied based on the life of the assets. In this example, it calculates depreciation for an asset with a cost of $120, a 10% annual depreciation rate, and a 6-month life, between January 1, 2022, and December 31, 2022.
AMORLINC(120, “01/01/2022”, “12/31/2022”, 6)
The AMORLINC function calculates the depreciation for each accounting period using a linear depreciation method. In this example, it calculates depreciation for an asset with a cost of $120 and a 6-month life, between January 1, 2022, and December 31, 2022.
COUPDAYBS(“01/01/2022”, “06/30/2022”, 2, 1)
The COUPDAYBS function returns the number of days from the beginning of a coupon period until its settlement date. In this example, it calculates the number of days from the beginning of the coupon period (2) until the settlement date (1) for a period ending on June 30, 2022.
COUPDAYS(“01/01/2022”, “06/30/2022”, 2, 1)
The COUPDAYS function returns the number of days in the coupon period that contains the settlement date. In this example, it calculates the number of days in the coupon period (2) that contains the settlement date (1) for a period ending on June 30, 2022.
COUPDAYSNC(“01/01/2022”, “06/30/2022”, 2, 1)
The COUPDAYSNC function returns the number of days from the settlement date to the next coupon date. In this example, it calculates the number of days from the settlement date (1) to the next coupon date (2) for a period ending on June 30, 2022.
COUPNCD(“01/01/2022”, “06/30/2022”, 2, 1)
The COUPNCD function returns the next coupon date after the settlement date. In this example, it calculates the next coupon date (2) after the settlement date (1) for a period ending on June 30, 2022.
COUPNUM(“01/01/2022”, “06/30/2022”, 2, 1)
The COUPNUM function returns the number of coupons payable between the settlement date and maturity date, rounded up to the nearest whole coupon. In this example, it calculates the number of coupons payable between the settlement date (1) and maturity date for a period ending on June 30, 2022, with a frequency of 2.
COUPPCD(“01/01/2022”, “06/30/2022”, 2, 1)
The COUPPCD function returns the previous coupon date before the settlement date. In this example, it calculates the previous coupon date (2) before the settlement date (1) for a period ending on June 30, 2022.
CUMIPMT(0.05/12, 2, 5*12, 1, 12, 0)
The CUMIPMT function returns the cumulative interest paid on a loan between start_period and end_period. In this example, it calculates the cumulative interest paid on a loan with a 5% annual interest rate, 5 years term, 1st payment made after 12 months, and payments made monthly.
CUMPRINC(0.05/12, 2, 5*12, 1, 12, 0)
The CUMPRINC function returns the cumulative principal paid on a loan between start_period and end_period. In this example, it calculates the cumulative principal paid on a loan with a 5% annual interest rate, 5 years term, 1st payment made after 12 months, and payments made monthly.
DB(10000, 5000, 5, 1)
The DB function returns the depreciation of an asset for a specified period using the fixed-declining balance method. In this example, it calculates the depreciation of an asset with a cost of $10,000, a salvage value of $5,000, a 5-year life, and a 1-year depreciation period.
DDB(10000, 5000, 5, 1)
The DDB function returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify. In this example, it calculates the depreciation of an asset with a cost of $10,000, a salvage value of $5,000, a 5-year life, and a 1-year depreciation period.
DISC(“01/01/2022”, “12/31/2022”, 950, 1000)
The DISC function returns the discount rate for a security. In this example, it calculates the discount rate for a security with a settlement date on January 1, 2022, a maturity date on December 31, 2022, a price of $950, and a redemption value of $1,000.
DOLLARDE(100.25, 16)
The DOLLARDE function converts a dollar price expressed as an integer part and a fraction part into a dollar price expressed as a decimal number. In this example, it converts the price 100 25/16 into a decimal number.
DOLLARFR(100.25, 16)
The DOLLARFR function converts a dollar price expressed as an integer part and a fraction part into a dollar price expressed as a decimal number. In this example, it converts the price 100 25/16 into a decimal number.
DURATION(“01/01/2022”, “12/31/2022”, 0.05, 100)
The DURATION function returns the Macaulay duration for an assumed par value of $100. In this example, it calculates the Macaulay duration for a security with a settlement date on January 1, 2022, a maturity date on December 31, 2022, a yield of 5%, and a par value of $100.
EFFECT(0.06, 4)
The EFFECT function returns the effective annual interest rate, given the nominal annual interest rate (APR) of 6% and the number of compounding periods per year (4).