Forum Discussion

user1164's avatar
user1164
Regular Visitor
3 years ago
Solved

XIRR for multi-period

Hi everyone, 

 

I'm new here and thank you for your help in advance. 

 

I am trying to calculate XIRR for commercial real estate returns. The differences compared to stocks XIRR are, I have cash flows from operations and closing value for the net asset value of the property at each quarter end.  

 

My issue is, if I select Q1 and Q2 of 2020, XIRR will include the March 31 and April 1 closing and opening balances when it should only consider January 1 and June 30 for a YTD XIRR. Does anyone know a dynamic way that these values can be excluded? 

 

My sample data below. 

Date$Type
1/1/2020-        1,000Opening
2/1/2020                10Cash flow
2/15/2020                10Cash flow
3/31/2020          1,010Closing
4/1/2020-        1,010Opening
4/7/2020                20Cash flow
5/3/2020-                 5Cash flow
6/30/2020          1,050Closing
7/1/2020-        1,050Opening
7/10/2020-              10Cash flow
8/10/2020                20Cash flow
9/10/2020                20Cash flow
9/30/2020          1,060Closing

 

Thank you! 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi user1164 

    You can refer to the following suggestion.

    First, you need to create a data table

    Then create a measure

    Measure = var a=FILTER(ALLSELECTED('Table'),[Type]="Opening"&&QUARTER([Date])=MINX(VALUES('Table 2'[Date]),QUARTER([Date])))
    var b=FILTER(ALLSELECTED('Table'),[Type]="Closing"&&QUARTER([Date]) =MAXX(VALUES('Table 2'[Date].[QuarterNo]),[Date].[QuarterNo]))
    return IF(ISFILTERED('Table 2'[Date].[Quarter]),IF(OR(SELECTEDVALUE('Table'[Date])=MINX(a,[Date]),SELECTEDVALUE('Table'[Date])=MAXX(b,[Date])),1,0),1)

    Then put the measure to the visual filter

    Output

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi user1164 

    You can refer to the following suggestion.

    First, you need to create a data table

    Then create a measure

    Measure = var a=FILTER(ALLSELECTED('Table'),[Type]="Opening"&&QUARTER([Date])=MINX(VALUES('Table 2'[Date]),QUARTER([Date])))
    var b=FILTER(ALLSELECTED('Table'),[Type]="Closing"&&QUARTER([Date]) =MAXX(VALUES('Table 2'[Date].[QuarterNo]),[Date].[QuarterNo]))
    return IF(ISFILTERED('Table 2'[Date].[Quarter]),IF(OR(SELECTEDVALUE('Table'[Date])=MINX(a,[Date]),SELECTEDVALUE('Table'[Date])=MAXX(b,[Date])),1,0),1)

    Then put the measure to the visual filter

    Output

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Hi,

    Based on the data that you have shared, show the expected result very clearly.