Forum Discussion

sanjaymithran's avatar
sanjaymithran
Icon for Helper II rankHelper II
3 years ago
Solved

How to calculate IRR using DAX

Hi All, XIRR=XIRR(Data,Data[Cash Flow],Data[DATE]) working fine we have function getting same as mentioned below. I tried as explained  in that video getting 0% but in excel 0.45% IRR = XIRR ( A...
  • OwenAuger's avatar
    3 years ago

    Hi sanjaymithran 

    I loaded your Data table exactly as in your post, and tried your IRR measure, and did get a result of 0.45%.

    See attached PBIX.

     

    To confirm, do you want to replicate the behaviour of the Excel IRR function, which takes an ordered list of cashflows and assumes they occur at 1-year intervals (in this case by ignoring the DATE column)?

     

    You can also write this more simply as something like this:

    IRR 2 = 
    XIRR (
        'Data',
        Data[Cash Flow],
        RANK ( DENSE, ALL ( 'Data'[DATE] ) )
            * 365
    )

    The interval between the Date values is important, rather than their magnitude, so there is no need to add the minimum date.

     

    Please post back if needed.

    Regards