Forum Discussion
XIRR Calculation Error
- 5 years ago
The problem is with that first date being a net-zero transaction. Try filtering out such days.
IRR = VAR Summary = SUMMARIZE ( Table, Table[Transaction Date], "@Amt", SUM ( Table[Amount] ) ) VAR FilterZeros = FILTER ( Summary, [@Amt] <> 0 ) RETURN XIRR ( FilterZeros, [@Amt], [Transaction Date] ) - 5 years ago
The first transaction is the culprit again. Having a small value like that as the first transaction is destabilizing and the XIRR function is not very robust. I don't know of a good general solution to fix this deficiency but I have applied some tricks in my reports that sometimes work.
For example, if you modify the data slightly to invest an extra $100 for one day so that instead of -1 on 9/1/2009 you have -101 on 9/1/2009 and 100 on 9/2/2009, then XIRR does converge. This modification does not materially change the result but it improves the stability of XIRR convergence.
I appreciate your prompt response on this issue, well modifying cash flows themselves would be challenge but I can probably modify them on a powerquery level.
Thanks again,
Brian
- AlexisOlson5 years agoSuper User
Yes, I did the modification in Power Query as well (before eventually pushing that logic upstream to a SQL view).