Forum Discussion

markusb73's avatar
markusb73
Regular Visitor
2 years ago
Solved

Help with XIRR, SELECTEDVALUE and Matrix table with multiple columns values

Hello, I am having problems to show XIRRs for a set of multiple dates with SELECTEDVALUE. The same IRR calculation for any single date however works fine!   The code is as follow: XIRR Yearly wit...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi markusb73 ,

     

    Try it:

    XIRR Yearly with Selectedvalue =
    
    var EndDate = LASTDATE('Tab_SelectedDates'[DateS]) 
    
    var StartDate = Date(year(EndDate)-1,12,31) 
     
    
    var CF_Start=CALCULATETABLE('Tab_StartValues','Tab_StartValues'[Date]=StartDate)
    
    var CF_Op=CALCULATETABLE('Tab_CFValues', 'Tab_CFValues'[Date]>StartDate && 'Tab_CFValues'[Date]<EndDate)
    
    var CF_End=CALCULATETABLE('Tab_EndValues','Tab_EndValues'[Date]=EndDate)
    
    var CF_Union=CALCULATETABLE(union(CF_Start,CF_Op,CF_End)) 
    
    var IRR= CALCULATE(XIRR(CF_Union,[Wert],[Date]))

    Best Regards,

    Neeko Tang

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