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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
March PBI video - carousel

Power BI Monthly Update - March 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors