Forum Discussion

Nagesh20's avatar
Nagesh20
Helper I
2 years ago

XIRR error with different methods

Hi All,

 

I have used the following two methods to calculate XIRR. Both are giving the right values as like as in the excel. But when coming to calculate XIRR, it’s getting error. In excel, it’s showing IRR of around 2.2%. After struggling for many hrs, I am reaching out for the help. Please someone assist on this query. Any either of below method works for IRR calculation below, that would suffice.

 

Total_Value 1st method =

var Running_ =

CALCULATE(SUM(Fund[Daily NAV]),FILTER(ALL(Fund[Date]),Fund[Date]<=MAX(Fund[Date]))) -- Running total for daily NAV

Var _max=maxx(filter(allselected(Fund), Fund[Fund] = max(Fund[Fund])&&Fund[User]=MAX(Fund[User]) ), Fund[Date])

return

-Switch ( true(),Max(Fund[Date]) = _max ,Running_,Max(Fund[Date]) < _max ,0.1) -- locking Ending NAV from Running total based on Max date

+SUM(Fund[Call])-SUM(Fund[Distribution])

 

IRR_1st method = XIRR(Fund,Fund[Total_Value 1st method],Fund[Date],,0.0001)

 

 

2nd method

Total_Value 2nd method =

var Running_ =

CALCULATE(SUM(Fund[Daily NAV]),FILTER(ALL(Fund[Date]),Fund[Date]<=MAX(Fund[Date]))) -- Running total for daily NAV

Var _max=maxx(filter(allselected(fund), Fund[Fund]= max(Fund[Fund])&&Fund[User]=MAX(Fund[User]) ), Fund[Date])

return

-Switch ( true(),Max(Fund[Date]) = _max ,Running_, Max(Fund[Date]) < _max ,0.1,blank()) -- locking Ending NAV from Running total based on Max date

+SUM(Fund[Call])-SUM(Fund[Distribution])

 

IRR_2nd method = XIRR(Fund,Fund[Total_Value 2nd method],Fund[Date],,0.0001)

 

 

DateUserFundCallDistributionDaily NAV
4/5/2022SecondFund15000500
6/5/2022SecondFund1025-25
7/5/2022SecondFund126036
7/6/2022SecondFund1000
8/5/2022SecondFund13545-10
9/5/2022SecondFund11000100
4/5/2023ThirdFund1100001000
5/5/2023ThirdFund145045
5/5/2023SecondFund125025
6/5/2023ThirdFund1025-25
7/5/2023ThirdFund126036
8/5/2023ThirdFund13545-10
9/5/2023ThirdFund11000100
9/5/2023SecondFund10026
3/5/2024FirstFund11000100
4/5/2024FirstFund150050
5/5/2024FirstFund125026
6/5/2024FirstFund15000502
7/5/2024FirstFund10100-100
9/5/2024FirstFund175075
9/5/2024SecondFund1000
10/5/2024FirstFund10250-250
10/5/2024ThirdFund10026