Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
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