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
IsmoO
Frequent Visitor

Predicting future assets, is this recursion or not?

Hi

 

I've have not found from forums (yet) help for this, whether it's possible or not, as quite a novice still on BI.

I have had tough times trying to convert this simple excel to BI to enable online grahs with different WhatIf parameters, but not sure is it impossible due to recursion limitation; I do need to refer previous row column to get start value for next row. While trying I have bumped occasionally to infamous 'circular depedency detected…' though.

  • I've read Greg's post on recursion not possible, though not fully grasping details ;),
  • but then again in my another calculation for cumulative returns was able to apply Gerhards way around

 

So below simple sample shows for each I'm trying to calculate total assets after gains, incomes and expenses, and then use it as beginning value for next year's calculations

Predicting future assets.png

 

same in xls in g-drive

 

Br Ismo

 

3 REPLIES 3
IsmoO
Frequent Visitor

So may I interepret this is impossible task and recursion unavoidable

Anonymous
Not applicable

Hi @IsmoO 

 

I finished reading this blog post and I think the method described by the author is probably the most useful for now.

 

Previous Value (“Recursion”) in DAX - Microsoft Fabric Community

 

So in response to your question, I ran some tests:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1723704071290.png

 

First, go to the power query and add an index column.

 

vnuocmsft_1-1723704357592.png

 

Create measures.

 

Measure 1 = 
IF(
    SELECTEDVALUE('Table'[Index]) <> 1,
    CALCULATE(
        SELECTEDVALUE('Table'[Assets at end of year after gains]),
        FILTER(
            ALL('Table'),
            'Table'[Year] = MAX('Table'[Year]) - 1
        )
    ),
    SELECTEDVALUE('Table'[Assets at beginning of year])
)

 

Measure 2 = 'Table'[Measure 1] * 0.05

 

Measure 3 = 
IF(
    ISBLANK(SELECTEDVALUE('Table'[Wages])),
    CALCULATE(
        MAX('Table'[Wages]),
        FILTER(
            ALL('Table'),
            'Table'[Index] = MAX('Table'[Index]) -1)
        ),
    SELECTEDVALUE('Table'[Wages])
)

 

Measure 4 = 
IF(
    ISBLANK(SELECTEDVALUE('Table'[Costs])),
    CALCULATE(
        MAX('Table'[Costs]),
        FILTER(
            ALL('Table'),
            'Table'[Index] = MAX('Table'[Index]) -1)
        ),
    SELECTEDVALUE('Table'[Costs])
)

 

Measure 5 = 
'Table'[Measure 1] + 'Table'[Measure 2] + 'Table'[Measure 3] - 'Table'[Measure 4]

 

Measure 6 = 'Table'[Measure 5] * 0.05 

 

Measure 7 = 'Table'[Measure 5] + 'Table'[Measure 6] 

 

Create a new table.

New Table = 
SELECTCOLUMNS(
    'Table',
    "year",
    'Table'[Year],
    "Assets at beginning of year",
    'Table'[Measure 1],
    "Divididends 5%",
    'Table'[Measure 2],
    "Wages",
    'Table'[Measure 3],
    "Costs",
    'Table'[Measure 4],
    "Assets end of year before gains",
    'Table'[Measure 5],
    "Assets value gain 5%",
    'Table'[Measure 6],
    "Assets at end of year after gains",
    'Table'[Measure 7]
    )

 

Here is the result.

 

vnuocmsft_2-1723704598397.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Thanks for your help

I'm not sure does this really work, I mean if I remove from excel all but the the start value of the whole chain, it calculates only the first row, see the picture

And the idea really was to dynamically calculate data and alter only start valea (+ all other as well via What-If parameters)

Predicting future assets with minimum start values.png

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.

Top Solution Authors