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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

How to get value from previous row in current calculated column

Hi, 

 

I am trying to replicate the following calculation in DAX, where I want to get the value from the previous row in the current column (B). 

 Example.PNG

3 ACCEPTED SOLUTIONS
tamerj1
Community Champion
Community Champion

Hi @Anonymous 
If B is a calculated column then

B =
SUMX (
    FILTER ( 'Table', 'Table'[Index] <= EARLIER ( 'Table'[Index] ) ),
    'Table'[A]
)

View solution in original post

Hi @Anonymous 
Please refer to attached sample file with the proposed solution

1.png

B = 
COALESCE (
    DIVIDE (
        1,
        PRODUCTX ( 
            FILTER ( 
                'Table',
                'Table'[Index] <= EARLIER ( 'Table'[Index] )
                    && 'Table'[Index] > 1 
            ),
            ( 1 + 'Table'[A] ) ^ (1/16)
        )
    ),
    1
)

The numbers do not 100% match yours, but when I made the my own excel sample file, the numbers were 100% matching. Could it be a rounding error?

View solution in original post

@Anonymous 
1.png

Value = 
COALESCE (
    PRODUCTX (
        FILTER ( 
            Table2,
            Table2[Index] <= EARLIER ( Table2[Index] )
                && Table2[Index] > 1 
        ),
        1 + Table2[A]
    ) * 100,
    100
)

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I have another similar issue. 
Initial value in column C (C1) = 100
The following values in column C is:  C_i (C_i where i > 1) =  C_i-1 *(1+A_i)

PowerBI_example.PNG

@Anonymous 
1.png

Value = 
COALESCE (
    PRODUCTX (
        FILTER ( 
            Table2,
            Table2[Index] <= EARLIER ( Table2[Index] )
                && Table2[Index] > 1 
        ),
        1 + Table2[A]
    ) * 100,
    100
)
tamerj1
Community Champion
Community Champion

Hi @Anonymous 
If B is a calculated column then

B =
SUMX (
    FILTER ( 'Table', 'Table'[Index] <= EARLIER ( 'Table'[Index] ) ),
    'Table'[A]
)
Anonymous
Not applicable

That did work fine. What if I want to expand the complexity by the following, knowing that B1 = 1, Example2.PNG

Hi @Anonymous 
Please refer to attached sample file with the proposed solution

1.png

B = 
COALESCE (
    DIVIDE (
        1,
        PRODUCTX ( 
            FILTER ( 
                'Table',
                'Table'[Index] <= EARLIER ( 'Table'[Index] )
                    && 'Table'[Index] > 1 
            ),
            ( 1 + 'Table'[A] ) ^ (1/16)
        )
    ),
    1
)

The numbers do not 100% match yours, but when I made the my own excel sample file, the numbers were 100% matching. Could it be a rounding error?

Anonymous
Not applicable

Amazing, and thank you so much for solving my issue! ❤️

@Anonymous 

Ya that is pretty complex. I'll have a look at it tomorrow. 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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