Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello!
Please, I would like help to create a measure in dax to calculate the discounted payback indicator. I have the following data:
CAPEX | $ 1.000.000 |
DISCOUNT RATE | 15% |
PERIOD | CASH FLOW |
1 | $ 200.000 |
2 | $ 203.000 |
3 | $ 189.000 |
4 | $ 220.000 |
5 | $ 198.000 |
6 | $ 200.004 |
7 | $ 203.006 |
8 | $ 210.555 |
9 | $ 200.876 |
10 | $ 220.000 |
@Roberto_Ribei1 could you clarify what you mean by "broken payback", with an example?
I'm assuming you want to compute the Discounted Payback Period.
First, I suggest you set up your cash flow table with the capex as a negative cash flow in Period 0.
In my example PBIX attached:
The measures I created are:
Cash Flow Amount =
SUM ( Cashflow[CASH FLOW] )
NPV to Date =
VAR DiscountRate =
[Discount Rate Value]
VAR CurrentPeriod =
MAX ( Cashflow[PERIOD] )
-- XNPV treats 365 days one period for the purposes of calculation
VAR DaysPerPeriod =
365
VAR PeriodToDate =
FILTER ( ALL ( Cashflow[PERIOD] ), Cashflow[PERIOD] <= CurrentPeriod )
VAR NPV =
XNPV (
PeriodToDate,
[Cash Flow Amount],
Cashflow[PERIOD] * DaysPerPeriod,
DiscountRate
)
RETURN
NPV
Discounted Payback Period =
VAR DiscountRate =
[Discount Rate Value]
VAR PaybackPeriod =
MINX (
VALUES ( Cashflow[PERIOD] ),
VAR CurrentPeriod =
Cashflow[PERIOD]
VAR PeriodToDate =
FILTER ( ALL ( Cashflow[PERIOD] ), Cashflow[PERIOD] <= CurrentPeriod )
VAR NPV =
[NPV to Date]
RETURN
-- If NPV to date >= 0, return the period, otherwise blank (which is ignored by MINX)
IF ( NPV >= 0, Cashflow[PERIOD] )
)
RETURN
PaybackPeriod
Results look like this:
Does something like this work for you?
There may be adjustments needed depending how you want the calculation to work if your dataset includes multiple investments.
Regards
Dear Owen Auger,
Thank you very much for the help. And I still have a challenge, which is to calculate the "broken" payback. That is, the result must be 9, something.
Sincerely,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
8 | |
8 | |
6 | |
5 |
User | Count |
---|---|
19 | |
16 | |
10 | |
9 | |
8 |