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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nicolasvc
Helper III
Helper III

Take previous cell value to build a column

I have in table "Products" a simple column with one cell:

 

Products

1250

 

And other table "dates"

demandofferstock
132112001250+1321-1200
213220231371+2132-2023

 

And I need to fill the column stock with the value 1250 from table Products and then add 1321 - 1200 for the first cell, then with this value 1250+1321-1200= 1371 I need to do the same procedure, but for the next rows down, how can I take the value of the previous cell in the same column and work from it?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nicolasvc ,

Add an index column. Transform data>> Add column>>From 1

11.PNG

22.PNG

Create a column.

stock = calculate(sum('dates table'[demand])-sum('dates table'[offer])+MAX(products[Products]),FILTER('dates table',[index]<=EARLIER('dates table'[Index])))

33.PNG

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Best Regards

Community Support Team _ Polly

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @nicolasvc ,

Add an index column. Transform data>> Add column>>From 1

11.PNG

22.PNG

Create a column.

stock = calculate(sum('dates table'[demand])-sum('dates table'[offer])+MAX(products[Products]),FILTER('dates table',[index]<=EARLIER('dates table'[Index])))

33.PNG

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Best Regards

Community Support Team _ Polly

Thanks very much! I really appreciate it.

richbenmintz
Resident Rockstar
Resident Rockstar

Hi @nicolasvc ,

Does the "dates" table provide a product_id and a date to sort by?

How are the products and dates tables related?



I hope this helps,
Richard

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

Proud to be a Super User!


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors