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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Weighted Average Yield to Maturity

Hello,

 

I would like to make a table like Image 1 that shows the weighted average Yield to maturity for various portfolios.  The data I am working with looks like the below image 2.

 

Image 1:

RBraun_1-1652810187118.png

 

In Excel I use the formula =SUMPRODUCT(--(Days Remaining>0),Yield,Amount)/SUMIF(Days Remaining,">0",Amount)

basically the calculation is the sum of the products of yield % times the amount for each investment that hasn;t matured yet.  Days remaining is also a calculation: [maturity date-Today()]

And each portfolio has it's own individual calculation, we just cell reference them on a different table to see them together.

 

The important part is that I only want to perform this calculation for maturity dates in the future, or in other words where days remaining is greater than 0

How do I recreate this formula in Power BI?

 

Image 2:

RBraun_0-1652809702966.png

Thank you for your help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you but this formula seemed to work to create a measure that could then be placed into a table

 

Wtd Avg YTM = DIVIDE(SUMX(Data,Data[Yield]*Data[Amount]),SUM(Data[Amount]))

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Anonymous
Not applicable

Thank you but this formula seemed to work to create a measure that could then be placed into a table

 

Wtd Avg YTM = DIVIDE(SUMX(Data,Data[Yield]*Data[Amount]),SUM(Data[Amount]))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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