Forum Discussion

SebaG's avatar
SebaG
Frequent Visitor
7 years ago
Solved

SKU count ver. SKU bellow minimum

Hi All   I need to count how many of my SKU's are bellow minimum.   Firstly I counted my SKU's = DISTINCTCOUNT('weekly stock'[Item Code]) Than I counted SKU's with 0 inventory = CALCULATE(DISTIN...
  • Anonymous's avatar
    Anonymous
    7 years ago

     

    Measure 1: Number of Items 

    NoOfItems = DISTINCTCOUNT(WeeklyInventory[ItemCode])

    Measure 2: Number of items with zero stock

    ZeroStockItemCount =
    CALCULATE (
        DISTINCTCOUNT ( WeeklyInventory[ItemCode] ),
        WeeklyInventory[StockQuantity] = 0
    )

    Add a Calculated Column to your inventory table

     

    MinimumStock = WeeklyInventory[CaseQuantity]*RELATED(Factors[Factor])

    Remember to create a relationship between as follows...

     

    Factors[ItemClass] -> WeeklyInventory[ItemClass]

    Filter Direction: One to Many

     

    Measure 3: Items with inventory less than minimum stock level.

     

    LessThanMinimumStockItemCount =
    COUNTROWS (
        FILTER (
            WeeklyInventory,
            WeeklyInventory[StockQuantity] < WeeklyInventory[MinimumStock]
        )
    )