How to count num shops having stock 0 grouped at shop level?
Raw Data:
Stock
Field ITEM_PART_NUMBER
Shop A
Shop B
Shop C
Shop D
Items in substitution group 1 (PIVOT_ITEM_TYPE = 'SUBST'
Item 1
Substituting item
1
1
1
0
Item 2
Substituded item
1
0
0
0
Item 3
Substituded item
1
0
0
0
Item 4
Substituded item
1
0
1
0
Item 5
Substituded item
1
0
1
0
Is Stock for all items in Substitution Group 1 aggregated At shop Level > 0 for previous day?
Yes as stock is 5
Yes as stock is 1
Yes as stock is 3
No as stock is 0
Thereby, KPI should return me count of shops = 1 having stock 0 grouped at substitution group 1 level and at each shop for the previous day
My question is how do I calculate a KPI which will return me only the count of shops having stock 0 grouped at substitution group 1 level and at each shop for the previous day?
I have tried the following possibilities but they are not working: