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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
rahul_sudhakar
Regular Visitor

Calculating based on previous row same column

 

In Power BI is it possible to refer the new column previous row value?.

I have an excel that looks like this with columns Date, Actual, Planned and Expected

P BI.png

The formula for Expected column is as above

How can I get the values of Expected  column if I port the same excel in Power BI.

I have referred to a couple of solutions for accessing a previous row value but none of the solutions is referring to accessing the same column of the previous row.

 

Thank you in Advance.

 

Rahul

 

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @rahul_sudhakar 

 

Kindly find my results:

2.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @rahul_sudhakar 

 

Kindly find my results:

2.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Thanks all for the support. Solution from v-diye-msft worked for me.

amitchandak
Super User
Super User

@rahul_sudhakar , Try like


Expected =
var _maxA = maxx(filter(Table, not(isblank(table[Actual]))),Table[Date])
return
CALCUALTE(sum(Table[Actual]), filter(all(Table),Table[Date]=_maxA)) + CALCUALTE(sum(Table[Planned]), filter(all(Table),Table[Date]>=_maxA && Table[Date]<=max(Table[Date])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
harshnathani
Community Champion
Community Champion

HI @rahul_sudhakar ,

 

 

You can check this blog to get values from previous row in the same column.

 

https://community.powerbi.com/t5/Community-Blog/Getting-Previous-Values-in-Power-BI-Part-1/ba-p/1143...

 

Regards,

Harsh Nathani

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Kudoed Authors