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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
TorsteinZahl
Frequent Visitor

XIRR and Date Table

I have an issue with Star Modelling my XIRR Formula.. I can't simply get it to work.. I have tried and tried, so decided to ask here. 

 

My Fact data is:

TorsteinZahl_0-1645432376134.png

 

My Relationsship with dates are like this:

TorsteinZahl_1-1645432424627.png

 

Im trying to Calculate the formula XIRR per Quarter and with a Quarter slicer for futher calculations. 

My fact table dont have "first value" in minus like the XIRR formula needs. So I took a work around with this DAX in order to get PreviousQuarter Lastdate Value in to the table.

TorsteinZahl_3-1645432841355.png

 

And this is the Correct table for calculating XIRR!! I have an minus value to start and cashflow in pluss and value at end of period. 

However my XIRR woould not wtok... I tried this as my "best" failure. 

TorsteinZahl_4-1645432937054.png
TorsteinZahl_5-1645432946300.png

If anyone can help me with this XIRR problem I would be so thankfull!! 

Dont hesitate to ask 🙂 Links to files:
https://drive.google.com/drive/folders/1quE7m429GwhcSJEGJi5HdmeWHqeavuu-?usp=sharing

 

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @TorsteinZahl ;

You could delete the relationship or  create a new table without relationship.

vyalanwumsft_0-1645694240881.png

then create a measure.

Previous Quarter Value in Minus 2 = 
IF (
    QUARTER ( MAX ( [date] ) ) = QUARTER ( MAX ( 'dim_date'[Date] ) )
        && YEAR ( MAX ( [date] ) ) = YEAR ( MAX ( 'dim_date'[Date] ) ),
    SUM ( [sum] ),
    CALCULATE ( - SUM ( [sum] ), LASTDATE ( PREVIOUSQUARTER ( dim_date[Date] ) ) ))
XIRR = XIRR(ALL('Table'),[Previous Quarter Value in Minus 2],[date])

The final output is shown below:

vyalanwumsft_1-1645694299443.png

 


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @TorsteinZahl ;

You could delete the relationship or  create a new table without relationship.

vyalanwumsft_0-1645694240881.png

then create a measure.

Previous Quarter Value in Minus 2 = 
IF (
    QUARTER ( MAX ( [date] ) ) = QUARTER ( MAX ( 'dim_date'[Date] ) )
        && YEAR ( MAX ( [date] ) ) = YEAR ( MAX ( 'dim_date'[Date] ) ),
    SUM ( [sum] ),
    CALCULATE ( - SUM ( [sum] ), LASTDATE ( PREVIOUSQUARTER ( dim_date[Date] ) ) ))
XIRR = XIRR(ALL('Table'),[Previous Quarter Value in Minus 2],[date])

The final output is shown below:

vyalanwumsft_1-1645694299443.png

 


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

TorsteinZahl
Frequent Visitor

Thanks for the reply. I have seen your video and thanks for your video in Excel and for the Curbal video. Both those examples just calculate directly on one table. I have not seen how to incorporate the Star Schema / Date Table

amitchandak
Super User
Super User

@TorsteinZahl , I have not tried this, I tried a few other financial functions.

Please refer to these two videos that can help

https://www.youtube.com/watch?v=N1WRSFuaFmE

https://www.youtube.com/watch?v=rHZ4hj5eh10

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.