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
MarkCBB
Helper V
Helper V

Number of consecutive dates with a specific value (Days Out Of Stock)

Hi there,

 

I don't even know how to start with this measure.

I have a simple dataset, (Fact, Stores, Products, Calendar).

I have created a report page those shows products by Store that have Zero SOH (Stock On Hand) as of the last date within the Fact table. I would like to calculate the number of consecutive days that the Product in a store has had a Zero Stock on Hand value (SOH is a column in the fact table as is Date.

 

I have been able to calculate how many days within a range have has zero stock, but I need to calculate the consecutive days. 

Example if product X in store A has a SOH value of 12 on the 13th, then zero on the 14th, 15th, 16th, the result should be 3 (14th-16th).

 

I have no idea how to even start figuring this out. 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @MarkCBB,

 

There is almost the same requirement in this thread. Please check out the demo there. If you'd like more support, please provide a dummy sample file.

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
affan
Solution Sage
Solution Sage

Hi @MarkCBB

Can you please share some sample data and the expected result here. Or share the pbix file

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
Top Kudoed Authors