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
s_fs
Frequent Visitor

count of values based on condition

I have created a table visual there I have a column which is numeric and it is weekyear like 202501,202502,202503 ... Then I have a another columns called in-hand goods and demand  for the respective weekyear. Now I want to create measure how much I have covered. This measure says that my present weekyear,let say 202501 in-hand goods are 4000 and demand for 202502 is 2000 means I can survive next week with my inhand goods and then we will check for next week 202503 demand which is 1500 . So, we still can survive 202503 week also, for 202504 demand is 1000 . Now comes the point where you exhausted with your inhand stock which is 2000+1500+1000 >= 4000.now I want to count the distinct weekyear which is 3  here. Also the safe week means 202503 is the week where we are safe with our goods based on the demand.so,i need to get the sum means 2000+1500 =3500 also. Here 2 variable I need to achieve,Let me know how can I achieve this in dax.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

That's all very nice but what happens when new demand comes in, and when you restock?

 

DAX is incapable of doing conditional accumulations. Your only chance is Power Query List.Accumulate

 

Or - use a proper material planning app, rather than a reporting tool.

View solution in original post

4 REPLIES 4
s_fs
Frequent Visitor

Hi, As of now my data doesn't contain restock column . stock covered calculation I wanted to do based on 2 variables I have mentions ,I can't able to achieve those using DAX .

s_fs
Frequent Visitor

Hi ,as of now my data is not having restock column . the measure stock covered is based on the above variables that I have mentioned which is the count and sum of survival in hand goods.

lbendlin
Super User
Super User

That's all very nice but what happens when new demand comes in, and when you restock?

 

DAX is incapable of doing conditional accumulations. Your only chance is Power Query List.Accumulate

 

Or - use a proper material planning app, rather than a reporting tool.

s_fs
Frequent Visitor

Hi, As of now my data doesn't contain restock column . stock covered calculation I wanted to do based on 2 variables I have mentions ,I can't able to achieve those using DAX .

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.