Forum Discussion
Need help with IRR calculation
- Anonymous4 years ago
Hi Anonymous ,
Here are the steps you can follow:
1. Power Query – Check four columns – Unpivot Column.
2. Create calculated column.
Date = DATE( LEFT('Table2'[Attribute],4), SWITCH(TRUE(), RIGHT('Table2'[Attribute],1)="1",3, RIGHT('Table2'[Attribute],1)="2",6, RIGHT('Table2'[Attribute],1)="3",9, RIGHT('Table2'[Attribute],1)="4",12) ,1)3. Create calculated table.
Flase1 = SUMMARIZE( 'Table2','Table2'[Gender],'Table2'[Date], "Sum",SUMX(FILTER(ALL('Table2'),'Table2'[Gender]=EARLIER('Table2'[Gender])&&'Table2'[Date]=EARLIER('Table2'[Date])),[Value]))Flase2 = SUMMARIZE( 'Table2','Table2'[Type],'Table2'[Date], "Sum",SUMX(FILTER(ALL('Table2'),'Table2'[Type]=EARLIER('Table2'[Type])&&'Table2'[Date]=EARLIER('Table2'[Date])),[Value]))Flase3 = UNION('Flase1','Flase2')Flase4 = var _table1= SUMMARIZE( 'Flase3', [Gender], "Date","IRRCalc", "Sum", XIRR(FILTER(ALL(Flase3),'Flase3'[Gender]=EARLIER('Flase3'[Gender])),[Sum],[Date])) return UNION('Flase3',_table1)4. Result:
If you need pbix, please click here.
Need help with IRR calculation.pbix
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- unpivot your snapshots
- convert quarters into dates (first day of quarter or last day of quarter)
Then you can apply XIRR.
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523