Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
AndresOHV
Frequent Visitor

Calculating Yield and MAC Duration of a Bond

Hello!

I'am doing this matrix made in excel:

AndresOHV_2-1669212486929.png

 

It shows the interes, amortization and total cash flow of a bond.

I need to calculate the Yield considering the purchase date (negative value) and not the previous cash flows. I think I'm not able to use the YIELD function because it doesn't apply to Step up bonds (with different amortization coupons).

After that I need to calculate the columns (t, PVCashFlows and MAC) to sum this last and get the Macaulay Duration. 

Can anyone help me with this?

 

 

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @AndresOHV ,

Please review the following thread, hope it can help you resolve the problem.

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])

 

If the above one can't help you, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with calculation logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yiruan-msft !

Thank you for your reply. 

Unfortunately this is not working.

I need to first calculate the yield and there's where I have the problem. In excel I use the XIRR formula but I can't use one in Power BI because I need it to be calculated at the purchase moment (negative cash flow).

I'm adding a link to the PBI file below:

 

https://1drv.ms/u/s!AvSFZ2hooRIDgdc7_vDW4hDQ4eNQ9Q?e=OJPmH7

 

Hope you can see it. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.