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

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

Reply
Lukas21
Frequent Visitor

PowerBi count up CalenderWeek when Value in equals zero

Hello,

we have a PowerBi report in which the future stock per material per calendar week is forecasted. Now we want to add a value to this report and if the value 0 is forecast in a calendar week, we want to calculate +1 for each previous calendar week. So that the calendar week 2 weeks before 0 has the value 2 and so on.
You can see in the picture that in line 3 on 28.08 the stock goes to 0. Now in the new measure there should be a 1 in the week of 21.08. and a 2 in the week of 14.08....

Thanks for every help

 

Lukas21_0-1679923859847.png

 

1 REPLY 1
amitchandak
Super User
Super User

@Lukas21 , refer if these approach can help

 

Inventory Days
https://radacad.com/calculating-stock-on-hand-using-dax-power-bi-inventory-model
https://blog.enterprisedna.co/calculate-days-of-zero-stock-power-bi-inventory-management-insights/

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.