Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear friends,
How can I refer to the previous row in Power BI this way?
Thank you
Solved! Go to Solution.
If doing in DAX Calculated column, something like below.
Column =
VAR calc =
CALCULATE (
MAX ( [Amount] ),
FILTER ( Table, [Index] = ( EARLIER ( [Index] ) - 1 ) )
)
* (
1
+ CALCULATE (
MAX ( [Rate] ),
FILTER ( Table, [Index] = ( EARLIER ( [Index] ) - 1 ) )
)
)
RETURN
IF ( ISBLANK ( calc ), 1000, calc )
If doing in DAX Calculated column, something like below.
Column =
VAR calc =
CALCULATE (
MAX ( [Amount] ),
FILTER ( Table, [Index] = ( EARLIER ( [Index] ) - 1 ) )
)
* (
1
+ CALCULATE (
MAX ( [Rate] ),
FILTER ( Table, [Index] = ( EARLIER ( [Index] ) - 1 ) )
)
)
RETURN
IF ( ISBLANK ( calc ), 1000, calc )
Hi @Chihiro,
Thank you for your answer. Is it possible to write the formula inside "Amount" column in DAX?
Can't think of way to do it in DAX.
Let me think on it.
Depends on where you want to do the calculation.
In Query Editor ("M"): Replace #"PreviousStep" with acutal previous step name
= try #"PreviousStep"{[Index]-2}[Amount] * (1 + #"PreviousStep"{[Index]-2}[Rate]) otherwise 1000Since row index is 0 based, and your index column is 1 based, you'd subtract 2 from index column value to obtain row index of previous row.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 74 | |
| 50 | |
| 47 | |
| 44 |