Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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