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
Joshi_M
Helper I
Helper I

Measure for -Forward Stock Cover days

Hi,

I have been struggling to create a measure for calculation for Future stock coverage days.Below is a example of Matrix visual in Power BI.

Measure already created for Opening Stock,Demand , Receipts &  Closing Stock .

Opening stock = 

SUMX(
FILTER(ALLEXCEPT(ZBE_12WEEK_DEMAND_AP,ZBE_12WEEK_DEMAND_AP[Plant Text],ZBE_12WEEK_DEMAND_AP[Material Group Family],ZBE_12WEEK_DEMAND_AP[Material]),ZBE_12WEEK_DEMAND_AP[Index weeks]>=0 && ZBE_12WEEK_DEMAND_AP[Index weeks]<=MAX(ZBE_12WEEK_DEMAND_AP[Index weeks])-1),
[Act Stock])

Constraints as below

  1. Some slicers are already selected
  2. Year and week in text format
  3. Field available in Direct query in date format is (First day of the week)
  4. Fiels available for index weeks which is filtered for avlues between 0 &11

I want to use a measure to calculate the stock cover days  based on future demand

Kindly help  in creating a measure for Stock cover Days .

Example - Stock cover days for week 2021.06 = 14 ( closing stock = 20 , Demand =20 happens next 2 weeks hence 14)

 

Year /week2021.062021.072021.082021.092021.12021.112021.122021.132021.14
Material         
Material A         
Opening Stock 2020202020202020
Demand 400203001040030
Receipts 20 202020   
Closing Stock20402010304000-30
Stock Cover Days14.011.74.714.010.5    

Kindly respond Let me know if anything else is required.

Regards

Joshi M

2 REPLIES 2
Joshi_M
Helper I
Helper I

@amitchandak  Many Thanks for the Links.

I think the belw link will work
 https://community.powerbi.com/t5/Desktop/Days-of-supply/td-p/635223

However Not sure how to apply in my example.

kindly check my example and let me Know
Regards

Manish

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.