Forum Discussion

hammerman's avatar
hammerman
Frequent Visitor
4 years ago
Solved

Opening Stock For Multiple Products

Hi Power BIers, I've got a stock adjustment table that I'd like to use to calculate opening stock level. It's across multiple products and dates.    I'd essentially like to fill down the opening...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    4 years ago

    Hi, hammerman 

     

    You can manually modify the value of total. Use SELECTEDVALUE ( table[column]1 ) = BLANK ().

    Like this:

    measure =
    IF (
        SELECTEDVALUE ( Date[Date] ) = BLANK (),
        CALCULATE ( SUM ( Table[Inventory Value] ) ),//calculate total sum
        CALCULATE (
            LASTNONBLANKVALUE ( Date[Date], SUM ( Table[Inventory Value] ) ),
            FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
        )
    )
    

    Did I answer your question? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

    Best Regards,
    Community Support Team _ Janey