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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Bondeuz
Frequent Visitor

Subtract daily sold amounts from running total

Hi,

 

I am looking for a dax formula to subtract the daily sold amounts from the running total to predict a date were the inventory will be empty.

 

Here is my current visual objects.

Bondeuz_0-1685449856174.png

Here is my expectation of this formula, drawn by the purple line. For the line to start at the last transaction date then subtract the daily sold amounts and to show visually when the stock will be empty.

Bondeuz_1-1685449986621.png


For information my measurments looks like this.

Avail. Inv. = BON_Items[InventoryField]-(BON_Items[Y365_Qty_on_Sales_Order]-BON_Items[Y365_Qty_on_Component_Lines])
ArtTransSumABS = SUM(Yellow_ItemLedgerEntryBI[QuantityABS])
DaysBetween = DATEDIFF(FIRSTDATE(Yellow_ItemLedgerEntryBI[PostingDate]),LASTDATE(Yellow_ItemLedgerEntryBI[PostingDate]),DAY)
Total Quant. Trans. Div by Total Trans. Days = DIVIDE([ArtTransSumABS],[DaysBetween])

For my running total formula its made from the quick measurments.

Running Total for Quantity in Date = 
CALCULATE(
    SUM(Yellow_ItemLedgerEntryBI[Quantity]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)
0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.