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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
s_namon
New Member

How to sum value in next column

I want to calculate about how long that initial order will be ran out of stock

and this is sample of current data (M is sales of each month),

column "Month" is total month until stock ran out (I need this column)

1.JPG

Currently, i can write "if" formula like sample below, but in actual data i have around 36 months so it too long

Can i set formula as a VAR or not? Please help

 

Month = if(Sheet1[Initial order]-Sheet1[M1]<=0,1,
if(Sheet1[Initial order]-(Sheet1[M1]+Sheet1[M2])<=0,2,
if(Sheet1[Initial order]-(Sheet1[M1]+Sheet1[M2]+Sheet1[M3])<=0,3,
if(Sheet1[Initial order]-(Sheet1[M1]+Sheet1[M2]+Sheet1[M3]+Sheet1[M4])<=0,4,...........
1 REPLY 1
v-evelk
Microsoft Employee
Microsoft Employee

Hello,

 

It looks like a question concerning DAX. If so, I am afraid that it is out of our expertise therefore, it is better to ask in appropriate threads: this one, or another one.

 

Kind Regards,

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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