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

Join 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.

Reply
Anonymous
Not applicable

IRR error

Dear All,

 

I want to calculate the IRR but when I try to I get an error. What do I do wrong?

 

I used the following code:

ROLLING IRR =
VAR minIndex =
CALCULATE ( MIN ( 'TEST - Working Capital'[Index] ), ALL ( 'TEST - Working Capital' ) )
RETURN
IF (
'TEST - Working Capital'[Index] > minIndex && NOT(ISBLANK('TEST - Working Capital'[Data])),
CALCULATE (
XIRR (
'TEST - Working Capital',
'TEST - Working Capital'[Cash flow amount],
'TEST - Working Capital'[Transaction Date]
),
FILTER (
'TEST - Working Capital',
EARLIER ( 'TEST - Working Capital'[Index] ) >= 'TEST - Working Capital'[Index]
)
)
)

 

I filtered out one loan as an example.

Transaction DateCash flow amountTransaction TypeIndexROLLING IRR
1-10-20151.000.000, -€Facility - Purchase128#ERROR
31-10-2015€ 5.416,67Loan - Interest Payment136#ERROR
30-11-2015€ 5.416,67Loan - Interest Payment145#ERROR
31-12-2015€ 5.416,67Loan - Interest Payment168#ERROR
31-12-20156.000, -€Facility - Commitment Increase170#ERROR
31-1-2016€ 5.449,17Loan - Interest Payment190#ERROR
29-2-2016€ 5.449,17Loan - Interest Payment207#ERROR
31-3-2016€ 5.449,17Loan - Interest Payment228#ERROR
30-4-2016€ 5.449,17Loan - Interest Payment258#ERROR
31-5-2016€ 5.449,17Loan - Interest Payment274#ERROR
30-6-2016€ 5.449,17Loan - Interest Payment303#ERROR
31-7-2016€ 5.449,17Loan - Interest Payment326#ERROR
31-8-2016€ 5.449,17Loan - Interest Payment340#ERROR
30-9-2016€ 5.449,17Loan - Interest Payment373#ERROR
31-10-2016€ 5.449,17Loan - Interest Payment402#ERROR
30-11-2016€ 5.449,17Loan - Interest Payment428#ERROR
31-12-2016€ 5.449,17Loan - Interest Payment454#ERROR
31-12-20161.006, -€Facility - Commitment Increase465#ERROR
31-1-2017€ 5.454,62Loan - Interest Payment486#ERROR
28-2-2017€ 5.454,62Loan - Interest Payment512#ERROR
31-3-2017€ 5.454,62Loan - Interest Payment559#ERROR
30-4-2017€ 5.454,62Loan - Interest Payment574#ERROR
31-5-2017€ 5.454,62Loan - Interest Payment601#ERROR
30-6-2017€ 5.454,62Loan - Interest Payment634#ERROR
31-7-2017€ 3.818,23Loan - Interest Payment651#ERROR
31-7-2017€ 1.007.006,Facility - Paydown662#ERROR

 

regards, Toon

1 ACCEPTED SOLUTION

@Anonymous , I see need of one change, if this a measure then we need max in place of earlier

 

ROLLING IRR =
VAR minIndex =
CALCULATE ( MIN ( 'TEST - Working Capital'[Index] ), ALL ( 'TEST - Working Capital' ) )
RETURN
IF (
'TEST - Working Capital'[Index] > minIndex && NOT(ISBLANK('TEST - Working Capital'[Data])),
CALCULATE (
XIRR (
'TEST - Working Capital',
'TEST - Working Capital'[Cash flow amount],
'TEST - Working Capital'[Transaction Date]
),
FILTER (
allselected('TEST - Working Capital'),
MAx ( 'TEST - Working Capital'[Index] ) >= 'TEST - Working Capital'[Index]
)
)
)

 

Trying to check in a file

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , Can share the error, which it is giving. check any hyperlink to get that

 

also, check

https://www.youtube.com/watch?v=N1WRSFuaFmE

https://community.powerbi.com/t5/Desktop/Create-a-measure-to-calculate-IRR-live/m-p/186302

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak , he just gives me an error that he can't find a solution. (The XIRR function couldn't find a solution.)

 

Toon_Mees_0-1657687106550.png

 

@Anonymous , I see need of one change, if this a measure then we need max in place of earlier

 

ROLLING IRR =
VAR minIndex =
CALCULATE ( MIN ( 'TEST - Working Capital'[Index] ), ALL ( 'TEST - Working Capital' ) )
RETURN
IF (
'TEST - Working Capital'[Index] > minIndex && NOT(ISBLANK('TEST - Working Capital'[Data])),
CALCULATE (
XIRR (
'TEST - Working Capital',
'TEST - Working Capital'[Cash flow amount],
'TEST - Working Capital'[Transaction Date]
),
FILTER (
allselected('TEST - Working Capital'),
MAx ( 'TEST - Working Capital'[Index] ) >= 'TEST - Working Capital'[Index]
)
)
)

 

Trying to check in a file

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak , thanks that was the bug. Looked at it too long to see the error.

I want to make this a 'Rolling IRR' based on different projects. So that he changes the IRR everyday day per project. How  should I change the formula then?

@Anonymous , I tried out, Seem like for me only working combination are

 

for grand total/card

XIRR (
('TEST - Working Capital'),
calculate(Sum('TEST - Working Capital'[Cash flow amount])),
'TEST - Working Capital'[Transaction Date]
)

 

or

 

XIRR (
allselected('TEST - Working Capital'),
calculate(Sum('TEST - Working Capital'[Cash flow amount])),
'TEST - Working Capital'[Transaction Date]
)

 

refer to this video for around 6 Min, and check the suggestion. if that can help

https://everyday.cc/powerbi/learning/videos/curbal-dax-fridays-142-irr-xirr-and-xnpv-in-dax/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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