March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
03-05-2020 20:37 PM - last edited 10-25-2021 09:26 AM
As explained, here, a DAX implementation of the Macaulay Duration.
Macaulay Duration =
VAR __InterestRate = .06
VAR __PeriodNumber = 2
VAR __Table = 'Table'
VAR __Table1 =
ADDCOLUMNS(
ADDCOLUMNS(
__Table,
"__Discount", 1 / (1 + __InterestRate/__PeriodNumber)^[Index]
),
"__PV Cash Flow",[Index] * [Value] * [__Discount],
"__Current Bond Price",[Value] / (1 + __InterestRate/__PeriodNumber)^[Index]
)
RETURN
SUMX(__Table1,[__PV Cash Flow]) / SUMX(__Table1,[__Current Bond Price])
eyJrIjoiYjU1MzRiOGUtNWVmOS00N2ZlLTgyOWUtY2UyM2Y3NGIzNjljIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9