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(DISTINCTCOUNT('weekly stock'[Item Code]); FILTER('weekly stock'; 'weekly stock'[Volume]=0))

 

Now I want to see how many SKU's are bellow minimum. And the minimum will be based on box quantity and item class. Depends on item class, check full box quantity and multiply by factor and set a minimum, and than check current stock, and count SKU where current stock is less then minimum. Factor will be different for different item class.

 

Example; If item class is B2, than minimum quantity is 80% of a full box quantity. Item "0020" is B2, and full box is 100 pieces, the minimum will be 80 pieces, current stock is 378 pieces, so is above minimum.

 

If item class ic C3, tahn minimum quantity is 20% of a full box quantity. Item "0009" is C3, and full box is 50 pieces, the minimum will be 10 pices, current stock is 5 pieces, so is bellow minimum

 

Factors for item classes are:

ItemClassFactor
A11000%
A2700%
A3500%
A4300%
B1100%
B280%
B360%
B450%
C140%
C230%
C320%
C410%

 

Weekly inventory table looks like that:

 

ItemCodeStockQuantityItemClassCaseQuantity
00012C150
00028B450
00033B350
000419B450
00059C136
000653C136
000725C136
00080C250
00095C350
001063C450
00110C4100
0012253C1100
0013650B424
00141238B324
00151348B4100
0016576C2100
00170C4100
00180C4100
0019197B448
0020378B2100
00211991B1100
0022915B3100
0023494B448
00240C348
00250C4100
00260C4100
00270C412
00280C4100
00290C4100
0030115C412
0031163C36
0032370C26

 

If anyone nows the solution please explain.

Thank you, Sebastian

 

 

  • 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]
        )
    )

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

     

    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]
        )
    )
    • SebaG's avatar
      SebaG
      Frequent Visitor

      Thank You, now it so easy :)

       

      Step by step, great help.