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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.