Forum Discussion
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,000 | Opening |
| 2/1/2020 | 10 | Cash flow |
| 2/15/2020 | 10 | Cash flow |
| 3/31/2020 | 1,010 | Closing |
| 4/1/2020 | - 1,010 | Opening |
| 4/7/2020 | 20 | Cash flow |
| 5/3/2020 | - 5 | Cash flow |
| 6/30/2020 | 1,050 | Closing |
| 7/1/2020 | - 1,050 | Opening |
| 7/10/2020 | - 10 | Cash flow |
| 8/10/2020 | 20 | Cash flow |
| 9/10/2020 | 20 | Cash flow |
| 9/30/2020 | 1,060 | Closing |
Thank you!
- Anonymous3 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
- AnonymousNot 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.
- Ashish_Mathur
Super User
Hi,
Based on the data that you have shared, show the expected result very clearly.