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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
kumalasa
Frequent Visitor

Create new column with values on previous rows

Hello Threre,

 

I have a table that consists of the columns below, I would like to have a formula that creates the columns "Socket-InComplete" and "Socket-InNewValue".

 

Formula View

kumalasa_3-1670294568698.png

 

 

DAX View.

kumalasa_2-1670294178622.png

 

kumalasa_1-1670293822455.png

Greatly appreciate any insights on this please, thank you.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kumalasa , You need to create a cumulative/running total approach. You can use the previous row value which also calculating

 

example measure using date table

 

CALCULATE(SUM(Table[Stock In]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Stock Out]),filter(date,date[date] <=maxx(date,date[date])))

 

Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@kumalasa , You need to create a cumulative/running total approach. You can use the previous row value which also calculating

 

example measure using date table

 

CALCULATE(SUM(Table[Stock In]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Stock Out]),filter(date,date[date] <=maxx(date,date[date])))

 

Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak ,

Thank you very much for your help. I have been stuck on this problem for a long time.

 

kumalasa_1-1670300682322.png

 

kumalasa_0-1670300558469.png

 

Datagulf
Responsive Resident
Responsive Resident

Please accept the Solution b y @amitchandak 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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