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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Using Prior Month Data to Build Future Month Data

I have three tables. One of inventory, one for demand, and one for anticipated orders. Inventory is simply the current amount of inventory held. Demand is the amount anticipated to be bought every month on average for the next 12 months. Anticipated orders are the amount the company anticipates buying each month to resupply inventory.

The goal of this DAX equation is to see if I have 10 pieces of inventory at the start, and each month I expect two lose 2 pieces, when will I run out before resupply? At the end of the month, the total would then be the new total for the next month. In excel, using formulas I would get the following:

MonthExample12345678
InventoryA10864212108
DemandB22222222

Order

C000012000
Next MonthA-B+C = Next Months A8642121086


My Demand, Order, and Inventory Table share a unique identifier. All tables have a date to relate back to a calendar table.

I am struggling to get the dax to work where it reflects from one month to another, then to pull from the prior month after it has been calculated.

1 REPLY 1
lbendlin
Super User
Super User

This is a cumulative function so you need to use one of the *X DAX features like SUMX , and table variables to hold the intermediate results.

 

Have you considered doing this in Power Query instead? It has a List.Accumulate() function specifically for this scenario.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.