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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Reversed loop over dates

Hi,

 

I'm trying to make a model that can predict if I can deliver a certain plant from stock. Lets say that the plant takes up 2 quantity of "Item 1". Then I want to make a revesed loop from the largest date which is the 30/07/2020 and stop when it is no longer possible to deliver the item which will be on the 30/05/2020. It means that my possible delivery date is the 15/06/2020 because from that date I can deliver all the dates in the future from the known data.

 

How do I make a measure that can poste this date for me?

 

                       Quantity                   Accumulated

                       Transaction              quantity

Stock                                                    40

15/05/2020          -13                           27

30/05/2020          -26                            1

15/06/2020           10                           11

30/06/2020           -3                             8

15/07/2020           -4                             4

20/07/2020           10                           14

30/07/2020           -5                             9

3 REPLIES 3
Anonymous
Not applicable

File attached. The code works the way you wanted... but I don't think you have considered all the possible arrangements of dates and quantities.

 

Best

D

Anonymous
Not applicable

Hi,

 

Yeah it didn't solve it. The task I had seems to be difficult to solve with dax.

It was solve using SQL instead.

 

 

Anonymous
Not applicable

It's not difficult to solve with DAX. Problem is you have not defined the full logic. But if your SQL works - great 🙂

Best
D

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors