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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.