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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ssstaud
Frequent Visitor

Weighted average maturity

Hello,

I am working with bonds. (People give you money, you have to give it back eventually) 

Basically I am trying to create a graph with weighted time to maturity (the time the company has to give it back) and I can´t wrap my head around that. I am not able to create a measure that is able to do DATEDIFF correctly. 

 

The calculation logic of weighted time to maturity or weighted average maturity is basically this: 

ssstaud_1-1621328750176.png

 

It can also be interpreted as:

ssstaud_2-1621329874106.png

 

And I am trying to create a graph that looks like this: 

 

ssstaud_0-1621328520943.png

 

The problem is that I dont know how to create a measure with DATEDIFF, because I need the difference in dates for every month and every bond to be different. (for example: in may the time to maturity for a bond is for example 21 months, in june it is only 20, in july 19 and so on..)

The .pbix file is here:
https://mega.nz/folder/vlo0RCJS#Kxh79nbxIEPh05wX-h1hhw

 

I would appreciate any help whatsoever!

4 REPLIES 4
OnurTurna
New Member

Hi,

Is there any examples and/or guidance on this question?

Ssstaud, I have exactly the same problem, did oyu manage to solve this?

v-luwang-msft
Community Support
Community Support

Hi @ssstaud ,

The following article is related to weighted average, you can refer to it and hope it can give you ideas.

Sadly this does not help as this graph deals with dynamic time. I will try to depict my problem better this time.

 

What are the important values here:
mature_at: the time when our company has to pay the money back to the client 
amount: how much money we have to pay back (i.e. the weight)


The calculation logic is better described by this:

ssstaud_0-1621508965007.png

 

How it works: Lets say that in may 2016 a person bought a bond that matures in 5 yrs for the amount of $100. So WAM is for may 5 yrs. For June 2016 it is 4 yrs 11 months.
In July sb. bought a bond of the same value of $100 that also matures in 5 yrs. So for July 2016 the WAM is 4 yrs 11 months, because:

ssstaud_1-1621508964869.png

 

And the graph should look like this (eventually ending in a zero, because all the bonds matured i.e. the money was given back to the client) 

ssstaud_2-1621508965020.png

 

 

Thank you once again for helping me!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors