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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Aggregate by date, unsolved circular reference error

Hi,

 

so for work I need to set up future outstanding notionals of a mortgage portfolio. The amount is split up in sums and it is listed when prepayment is expected. See a symplified example below. For simplicity, it is a small portfolio that will be repaid in the next few months. For completeness I will add that I have a different table from which the data is sourced. The source is a table with a manyfold of below (data below where the portfolio is split in its components).

 

Date is set up by listing all unique dates from the other table.

 

Cash flow is created by aggregating all cash flows (of all portfolio components) by date into this table.

 

DateCash flow
31-07-202230,000

31-08-2022

25,000
30-09-202215,000
31-10-202230,000
30-11-202225,000
31-12-202245,000
31-01-202220,000

 

What I want to do is to add a column that shows what the outstanding notional is, which is a sum of the cash flow in the current date and the future ones. In excel I would formulate this as B2 = SUM(A2 : $A$7), so B3 = SUM(A3 : $A$7). This should look as below:

 

DateCash flowOutstanding notional
31-07-202230,000190,000

31-08-2022

25,000160,000
30-09-202215,000135,000
31-10-202230,000120,000
30-11-202225,00090,000
31-12-202245,00065,000
31-01-202220,00020,000

 

Now, I have tried a few options with help of the forum. Such as below.

 

Outstanding notional = CALCULATE (SUM (Summary[Cash flow]),FILTER (ALL (Summary ),'Summary'[Date] <= MAX ( 'Summary'[Date])))
Outstanding notional = CALCULATE(SUM(Summary[Cash flow]), ALL(Summary), Summary[Date] <= EARLIER(Summary[Date]))
 
It seems to work for others, but I get the following error message, indicating a circular reference.
pi>A circular dependency was detected: Summary[Notional normal BTL], Summary[Column], Summary[Notional normal BTL].</pi>
 
Can you please tell me what I am doing wrong? It would seem a rather simple execution (at least it is in excel) but I can't seem to figure this one out. Thanks in advance, much appreciated.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create a calculated column or measure as below to get [Outstanding notional], please find the details in the attachment...

Calculated column:

Outstanding notional = 
CALCULATE (
    SUM ( 'Summary'[Cash flow] ),
    FILTER ( 'Summary', 'Summary'[Date] >= EARLIER ( 'Summary'[Date] ) )
)

yingyinr_0-1658111268880.png

Measure:

Measure = 
VAR _seldate =
    SELECTEDVALUE ( 'Summary'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Summary'[Cash flow] ),
        FILTER ( ALLSELECTED ( 'Summary' ), 'Summary'[Date] >= _seldate )
    )

Running (Cumulative) Totals in Power BI

Cumulative Total/ Running Total in Power BI

In addition, you can refer the following links to understand the circular dependencies and how to avoid circular dependencies...

Understanding circular dependencies in DAX

Avoiding circular dependency errors in DAX

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can create a calculated column or measure as below to get [Outstanding notional], please find the details in the attachment...

Calculated column:

Outstanding notional = 
CALCULATE (
    SUM ( 'Summary'[Cash flow] ),
    FILTER ( 'Summary', 'Summary'[Date] >= EARLIER ( 'Summary'[Date] ) )
)

yingyinr_0-1658111268880.png

Measure:

Measure = 
VAR _seldate =
    SELECTEDVALUE ( 'Summary'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Summary'[Cash flow] ),
        FILTER ( ALLSELECTED ( 'Summary' ), 'Summary'[Date] >= _seldate )
    )

Running (Cumulative) Totals in Power BI

Cumulative Total/ Running Total in Power BI

In addition, you can refer the following links to understand the circular dependencies and how to avoid circular dependencies...

Understanding circular dependencies in DAX

Avoiding circular dependency errors in DAX

Best Regards

Anonymous
Not applicable

Thanks! This seems to work. Also big thanks for uploading a Power BI file and links to circular references in Power BI!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 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.