Forum Discussion

zyeet's avatar
zyeet
Frequent Visitor
2 years ago

Getting the minimum summed category

I have been trying to get the category name by summing all the values of products in each category. So far, this has worked right for getting the maximum summed category but not minimum. The measures I have used so far are:

 

SumMax = SUMX('FB Truck Data',Max('FB Truck Data'[Daily Dispensed])) 
for getting the maximum sum in each category
 
SumMin = SUMX('FB Truck Data',Min('FB Truck Data'[Daily Dispensed]))
for getting the minimum sum in each category
 
Maximum Dispensed Quantity Customer =
CALCULATE (
    MIN ( 'FB Truck Data'[Customer Name] ),
    FILTER ( 'FB Truck Data', MAXX ( 'FB Truck Data', [Daily Dispensed] ) = [SumMax] )
)
to get the customer name with max sum
 
Minimum Dispensed Quantity Customer =
CALCULATE (
    MIN ( 'FB Truck Data'[Customer Name] ),
    FILTER ( 'FB Truck Data', MINX ( 'FB Truck Data', [Daily Dispensed] ) = [SumMin] )
)
to get the customer name with min sum. This is where the issue is. It is not giving me the right minimum summed category.
 
As we can see in the table below, the values are already summed and showing up individually for each customer, and my maximum returns the right customer (Byrne Equipments), but Minimum returns the wrong customer (Clear Ice), instead of 'Sarab Al Madina'. I don't really understand why because sum min value gives 46.29 and not 130.70.

 

1 Reply