cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Failing to create a list of IRR values over a date range

Hi

I am building a report utilising the XIRR function.

I have not had any issues calculating values for specific dates. When I create a visual with a single date, it works fine.

However, I struggle to produce a tablethat includes multiple dates dates together with the corresponding IRR value.

It will simply produce this error message:

My IRR formula is this:

IRR = XIRR(VALUES('IRR Table'), [IRR Cashflow],'IRR Table'[As At Date])

I have another formula where I have tried to produce a "Rolling Total":
IRR Total =
CALCULATE(
'IRR Table'[IRR],
FILTER(
ALLSELECTED('IRR Table'[As at Date],'IRR Table'[Portfolio Name]),
ISONORAFTER('IRR Table'[As at Date], MAX('IRR Table'[As at Date]), DESC)
)
)

This doesn't work either.

I would like to produce this table of values so I can create a Line Chart with the IRR values.

Hope you can help out

thanks

Christian

1 ACCEPTED SOLUTION
Resolver II

To better identify where the issue lies, it would be a good idea to use the 'alternate result' functionality in the XIRR function, like so:

IRR = XIRR('IRR Table','IRR Table'[IRR Cashflow], 'IRR Table'[As At Date],,0)
Rather than just giving you an error, the visual will now instead display a zero for the dates it can't calculate.
Your rolling total is the kind of thing you need to use.

I suspect it can't calculate for some dates as XIRR demands both positive and negative values in the table of data it's working with, but the start/end point of your line chart will presumably only contain one data point, which can't both be positive and negative, hence error.
2 REPLIES 2
Frequent Visitor

Hi @Chris_White

Thanks for this. I tried to add 0 for the Alternate Result, and you were right. This now populates my table with values.

If I look at the IRR formula that I created it will produce a Zero value for all dates (as expected).

For the 'Running Total' formula, it is now accruately displaying the correct values for the corresponding dates.

However, it will also display a zero value for ALL dates corresponding to my date list.

So a quick fix for this was to filter the visual on the IRR Cashflow column to be "not blank"

Thanks

Well done.

Christian

Resolver II

To better identify where the issue lies, it would be a good idea to use the 'alternate result' functionality in the XIRR function, like so:

IRR = XIRR('IRR Table','IRR Table'[IRR Cashflow], 'IRR Table'[As At Date],,0)
Rather than just giving you an error, the visual will now instead display a zero for the dates it can't calculate.
Your rolling total is the kind of thing you need to use.

I suspect it can't calculate for some dates as XIRR demands both positive and negative values in the table of data it's working with, but the start/end point of your line chart will presumably only contain one data point, which can't both be positive and negative, hence error.

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors