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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
landryn
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.

 

landryn_0-1689766940673.png

 

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

It will simply produce this error message:

 

landryn_1-1689767038113.png

 

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
Chris_White
Resolver II
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.

View solution in original post

2 REPLIES 2
landryn
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.

landryn_0-1690414208549.png

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

 

landryn_1-1690414327913.png

 

Thanks

 

Well done.

 

Christian

 

 

Chris_White
Resolver II
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.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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