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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Aphax1477
Regular Visitor

Calculating stocks depending on best before dates

Hello,

 

I need some help with the following problem:

We have products with different best before dates. I would like to calculate how long the respective stock/best-before date will last and how much stock may need to be disposed of, given the current sales rate. For me, the start time of sales for the following BBDs is the crucial point here that needs to be calculated.

 

In this example here, the sale of the product with the first best before date must be stopped on 16/04, as the best before date has been reached and the sale of the next best before date batch begins.

Does anyone have any ideas on this? Many thanks in advance.

 

Aphax1477_0-1709551517349.png

 

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Aphax1477 I'm unclear what you are asking here. When you say the "sale of the product must be stopped" what does that mean exactly? 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

This means that Today=Bestbeforedate, we can no longer sell this batch of the product.
From now on, we can only sell the next batch of this product.

Hope this helps to explain the problem better.

@Aphax1477 OK, I *get* that much. The question is, what does that actually mean in terms of your report. Is there a particular calculation that you need, like a measure or ???



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I need a calculation of when the sale of the 2nd batch starts? Under the condition that the end of sales of the 1st batch can be either the best-before date or the out of stock date, whichever comes first.


Measure: Start date for sales

Sales Start Batch 1 = Today
Sales Start Batch 2 = ?
(Sales Start Batch 3 = ? ....)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.