Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Richml
Frequent Visitor

XIRR from a table of cash flows

Hi

I want to add a column that has the IRR for a project.

 

I have two tables:

1 - the Projects

2 - the Cash Flows

 

Tables linked 1-* on Project

Richml_1-1687369054775.png

 

Richml_0-1687368967653.png

Result is not filtering by row context - Help please!

Richard

1 ACCEPTED SOLUTION

The error was caused by project 3 for which there is no data in your Cash Flows table. This formula checks for this condition and works with your data:

IRR = 
IF (
    'Projects'[Project] IN VALUES ( 'Cash Flows'[Project] ),
    XIRR(FILTER('Cash Flows', 'Cash Flows'[Project] = 'Projects'[Project]), 'Cash Flows'[Cashflow], 'Cash Flows'[Cashflow date])
)

 

View solution in original post

6 REPLIES 6
Martin_D
Super User
Super User

This could be the easiest fix:

IRR = XIRR(FILTER('Cash Flows', 'Cash Flows'[Project] = 'Projects'[Project]), 'Cash Flows'[Cashflow], 'Cash Flows'[Cashflow date])

Thanks @Martin_D - this gave an error message "A result for XIRR could not be determined because the Values and Dates arguements are empty" 

 

Can you provide the file, pls.?

The error was caused by project 3 for which there is no data in your Cash Flows table. This formula checks for this condition and works with your data:

IRR = 
IF (
    'Projects'[Project] IN VALUES ( 'Cash Flows'[Project] ),
    XIRR(FILTER('Cash Flows', 'Cash Flows'[Project] = 'Projects'[Project]), 'Cash Flows'[Cashflow], 'Cash Flows'[Cashflow date])
)

 

Thanks @Martin_D ! 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.