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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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