Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Slow Moving Inventory in USD

Can anyone help me with a DAX on a logic to calculate the slow moving inventory in USD.   I have a Base Inventory value in USD (Base InvVal), a creation date, a consumption date. An inventory is s...
  • nickchobotar's avatar
    9 years ago

    Anonymous

    Here is my attempt to solve your problem. I am creating a range of dates for -12 - 36 months and comparing them to the dates in the dataset, if dates intersect then it's slowly moving stock and we can return the value.

     

     

     

    SM Inventory Value = 
    VAR SumOf = 
    CALCULATE(
        SUMX(
            Table2,
            Table2[Quantity] * Table2[Value]
        )
    )
    VAR Range = DATESINPERIOD('Calendar'[Date], EDATE(TODAY(), -12), -24, MONTH)
    RETURN
    CALCULATE(
        IF(
            COUNTROWS(
            INTERSECT(
               VALUES(Table2[Consumption Date]),
               Range)
           ) > 0, 
           SumOf, 0
        )
    )