Dax Function: MDURATION
Category: Financial Functions
The MDURATION function in Power BI is a DAX financial function that calculates the modified Macaulay duration of a security with periodic interest payments. This measure reflects the sensitivity of a bond’s price to changes in interest rates, accounting for discounted cash flows.
Purpose
To compute the weighted average time to receive a bond’s cash flows, adjusted for changing yields.
Primarily used in bond valuation and risk management to evaluate interest rate sensitivity.
Type of Calculations
Computes modified Macaulay duration for fixed-income securities.
Adjusts the traditional Macaulay duration to account for yield changes, providing more realistic interest rate risk measures.
Practical Use Cases
Bond Risk Assessment: Calculate interest rate sensitivity of bonds or fixed-income securities.
Portfolio Management: Optimize portfolio duration for risk-return balance.
Hedging Strategies: Design strategies to mitigate interest rate risks.
MDURATION(settlement, maturity, coupon, yield, frequency, basis)
| Parameter | Type | Description |
|---|---|---|
settlement | Scalar | The settlement date of the security (when it is purchased). |
maturity | Scalar | The maturity date of the security (when it expires). |
coupon | Scalar | The annual coupon rate of the security as a decimal. |
yield | Scalar | The annual yield of the security as a decimal. |
frequency | Scalar | The number of coupon payments per year (e.g., 1 = annual, 2 = semi-annual, 4 = quarterly). |
basis | Scalar | The day-count convention to use (e.g., 0 = 30/360, 1 = Actual/Actual, etc.). |
How Does MDURATION Dax Function Works
Mathematical Formula
Modified Macaulay duration is calculated using:
Where:
Macaulay Duration: The weighted average time to receive the bond’s cash flows.
Frequency: The number of periods in a year for coupon payments.
Steps:
Compute the present value of each cash flow (including coupons and principal).
Weight each cash flow by its time to payment.
Adjust the duration based on the bond’s yield and payment frequency.
What Does It Return?
Scalar Value: Returns the modified duration of the bond.
Expressed as a decimal value representing sensitivity to interest rate changes.
When Should We Use It?
Bond Analysis: Understand price sensitivity to interest rate changes.
Fixed-Income Strategy: Design interest rate hedging or immunization strategies.
Risk Quantification: Assess portfolio exposure to interest rate volatility.
Examples
Basic Usage :
Calculate modified duration for:
Settlement Date: January 1, 2025
Maturity Date: January 1, 2030
Annual Coupon: 5% (0.05)
Yield: 4.5% (0.045)
Frequency: 2 (Semi-Annual)
Basis: 0 (30/360)
MDURATION(DATE(2025, 1, 1), DATE(2030, 1, 1), 0.05, 0.045, 2, 0)
Result: 4.87 (example duration in years).
Column Usage
Apply the MDURATION function dynamically to a table with bond details:
| BondID | Settlement | Maturity | Coupon | Yield | Frequency | Basis |
|---|---|---|---|---|---|---|
| 1 | 01/01/2025 | 01/01/2030 | 0.05 | 0.045 | 2 | 0 |
| 2 | 01/01/2023 | 01/01/2028 | 0.06 | 0.05 | 1 | 1 |
Create a calculated column:
ModifiedDuration = MDURATION(Bonds[Settlement], Bonds[Maturity], Bonds[Coupon], Bonds[Yield], Bonds[Frequency], Bonds[Basis])
Generates the modified duration for each bond.
Advanced Usage
Combine MDURATION with other DAX functions for portfolio-level analysis:
PortfolioDuration =
SUMX(
Bonds,
MDURATION(Bonds[Settlement], Bonds[Maturity], Bonds[Coupon], Bonds[Yield], Bonds[Frequency], Bonds[Basis]) * Bonds[Weight]
)
Computes the weighted average duration for a bond portfolio.
Tips and Tricks
Ensure dates (settlement and maturity) are in proper format.
Verify that
frequencymatches the bond’s payment schedule.Use consistent units for
couponandyield.Invalid or mismatched dates (e.g., settlement after maturity).
Omitting adjustments for compounding frequency.
Performance Impact of MDURATION DAX Function:
Performance is efficient for scalar calculations.
Optimize for large datasets using aggregate functions like
SUMXorAVERAGEX.
Related Functions You Might Need
| Function | Description |
|---|---|
DURATION | Calculates Macaulay duration, ignoring yield adjustments. |
YIELD | Determines the bond’s annual yield. |
COUPNUM | Computes the number of coupon payments between settlement and maturity. |
Want to Learn More?
For more information, check out the official Microsoft documentation for MDURATION You can also experiment with this function in your Power BI reports to explore its capabilities.
Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.
The MDURATION function calculates the modified Macaulay duration of a bond, showing its sensitivity to interest rate changes.
The MDURATION function adjusts for yield changes, while DURATION provides a simple Macaulay duration without yield adjustments.
Yes, but the coupon rate should be set to 0 to reflect the lack of periodic interest payments.
The basis parameter specifies the day-count convention used for calculating dates (e.g., 30/360 or Actual/Actual).
Combine MDURATION with weights in your dataset to calculate the portfolio’s average duration.