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

Inventory Forecast Recursive Calculation

Hi all, I'm trying to create a DAX measure that populates "forecasted remanining inventory".

 

I have gone through Gerhard's blog on recursive calculation, but it talks about compound interest and not summation.

 

In Gerhard's blog, he replied in one of the comments saying it "should be easy" but I haven't been able to figure it out for 3 days already.

 

I have gone through this thread but I don't understand what the user wrote, nor the answer derived.

 

Capture.PNG

 

My attempt is:

Forecast Inventory = 
VAR PrevInv = CALCULATE ( SUMX(Table, Table[Inventory]), DATEADD( DateTable[Dates], -1, MONTH))

RETURN 
     IF ( ISBLANK ( Table[Inventory] ) ,
           PrevInv - SUMX(Table, Table [Sales]), 
           SUMX(Table, Table [ Inventory] ) 
       

I know that the "PrevInv" variable is not calculated correctly but I really don't know how else to proceed. Can anyone please help?

 

Assume that a DateTable has been created separately and is configured properly.

 

Thank you!

15 REPLIES 15

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.