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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tan_LC
Helper II
Helper II

Calculated column for ClosingStk using DAX

Hi,

 

In below table, I would like to calculate ClosingStk based on ShiftDate and SizeNo.

The first ClosingStk for the same SizeNo should be using InitialStkCount (column G) + CuredQty (column D) - StkInQty (column C).

Subsequent and remaining ClosingQty for the same SizeNo should be using ClosingStk from previous row (column F) + CuredQty (column D) - StkInQty (column C).

Please help.

 

Tan_LC_1-1706789404129.png

 

 

ShiftDateSizeNoStkInQtyCuredQtyInitialStkCount Closing
Stk
1/1/2024A001 100333 433
2/1/2024A001864964 433533
3/1/2024A001160263 533636
4/1/2024A001   636636
5/1/2024A001345550 636841
2/1/2024B00111212886 102
3/1/2024B0016852 10286
4/1/2024B001235300 86151
5/1/2024B001   151151
2/1/2024C001280336268 324
3/1/2024C001112126 324338
4/1/2024C001135250 338453
5/1/2024C001325400 453528

 

Thank you.

 

Regards,

LC

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1706805385851.png

 

for fun only, a showcase of powerful Excel formulas,

ThxAlot_1-1706806362600.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

1 REPLY 1
ThxAlot
Super User
Super User

ThxAlot_0-1706805385851.png

 

for fun only, a showcase of powerful Excel formulas,

ThxAlot_1-1706806362600.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.