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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
delmayhan
Frequent Visitor

Rolling Stock DAX Measure

Hi Guys,

I want to create a rolling stock measure in Powerbi from a base value that is a field. So till now what i created is this measure :

Planned Stock =
CALCULATE (
( [Planned Delivery Quantity (Base Unit)] -[Required Quantity (Base Unit)] ) ,
FILTER (
ALL ( 'Date'[Date] ),
'Date'[Date] <= MAX ( ( 'Date'[Date] ) )
)
) Planned Stock this works fine.

delmayhan_0-1697197652224.png

 

Only what i want to do is that it take a starting stock from this field sum('inventory[QuantityUnrestricted] ') then it does the same as the measure in the planned stock. I tried but it didnt succeed. This is the measure:

RollingStockWithStartValue =
VAR __startValue = SUM('Inventory'[QuantityUnrestricted])
VAR __currentRow = MIN('Date'[Date])

RETURN
    IF(
        ISBLANK(__currentRow),
        BLANK(),
        __startValue +
        CALCULATE(
            [Planned Delivery Quantity (Base Unit)] - [Required Quantity (Base Unit)],
            FILTER(
                ALL('Date'),
                'Date'[Date] <= __currentRow
            )
        )
    )
and this is the output
delmayhan_1-1697197916123.png

i wanted it to be on the 10/10/2023  1480-256,16 and from that point will that be the value till there is other requirement or delivery

 

1 REPLY 1
Anonymous
Not applicable

Hi @delmayhan ,

 

I think you can try code as below to create a new measure based on original [RollingStockWithStartValue] measure.

NEWRollingStockWithStartValue =
SUMX (
    FILTER ( ALL ( Date ), 'Date'[Date] <= MAX ( 'Date'[Date] ) ),
    [RollingStockWithStartValue]
)

If this reply still couldn't help you solve your issue, please share a sample file with us.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.