Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SebaG
Frequent Visitor

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

 

 

1 ACCEPTED SOLUTION
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]
    )
)

View solution in original post

2 REPLIES 2
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]
    )
)

Thank You, now it so easy 🙂

 

Step by step, great help.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.