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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ktb2296
Frequent Visitor

DAX: Referencing the previous row within the same Calculated Column

I am currently trying to create a calculated column whereby the first value in the row is the basis for the calculation, and the rest of the values in the column are built off of this value.

 

I am trying to understand if this is even possible in Power BI, but because it is doable in Excel, I would imagine that there is some sort of solution to this query. 

 

In the screeshot below, you'll notice the starting value for the calculated column needs to be the value that the arrow is pointing to (this will be a static value that I can plug in using the associated date, May 2016, as the parameter), which then needs to be used to build the value in the next row and so forth. 

 

 

ktb2296_1-1628773274447.png

 

 

 

Hoping someone can offer some advice or shed some light on how possible it is. Thanks in advance!

 

 

3 REPLIES 3
Anonymous
Not applicable

Hello , were you able to solve this problem. I am in a similar boat and have been clinging to this problem since weeks.

VahidDM
Super User
Super User

Hi @ktb2296 

I'm not sure how do you want to use the First row value to calculate the other columns/rows value, but to find the first value in the column you can use the "FIRSTNONBLANK" formula in DAX.

For your model you can use this code:

VahidDM_0-1628833774959.png

 

First Value = 
FIRSTNONBLANK ( 'Table (2)'[Revised rent], MAX ( 'Table (2)'[Revised rent] ) )

 

 

the output will be like below, and you can use that measure to create that calculated column:

VahidDM_1-1628833899344.png

 

As an another example, to find the first value in the Monthly Average column, use the below code:

because the first row in that column is empty, it shows the second row.

 

VahidDM_4-1628834147264.png

 

 

 

Did I answer your question? Mark my post as a solution!

Appreciate your Kudos VahidDM_3-1628833979920.png !!

HI Vahid,

 

This doesn't really answer the full query. Essentially the first row, or May 2016, will be 135 (Variable x)

 

Then to get the next value for June 2016, in the same column, I need to use this equation: 

 

1-ABS(0.5-NORM.Dist( Monthly Average , Variable X, Measure 1, TRUE) = Variable Y

 

Then to get the value for July 2016:

 

1-ABS(0.5-NORM.Dist( Monthly Average , Variable Y, Measure 1, TRUE)

 

This needs to continue on for the whole calculated column. So that's why I'm wondering if it's possible to calculate a column where each row will need to take the previous calculated row's value.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.