Forum Discussion

JoRose's avatar
JoRose
Frequent Visitor
2 years ago
Solved

Track Stock amount

Dear DAX/Power BI Community, I have the following issue. I want to record warehouse stock on a daily basis. To restrict the amount of new entries in the database, i want to record only those product...
  • some_bih's avatar
    2 years ago

    Hi JoRose I created two measure, based on your sample data, as following

    Adjust your proper fact / Calendar tables names and you should get output from Output (Date from Date table, not fact)

    1. Simple simple = SUM(factInventory[Quantity])

    2. Sum adjusted =
    IF (
        ISEMPTY ( factInventory ),
        CALCULATE ( [Simple simple] ,OFFSET ( -1,, ORDERBY ( 'Date'[Date] ), ) ),
        [Simple simple]
    )

     

    Output