Unable to sum a beast mode formula

I'm trying to get the first and last days of the selected date range and return dollar amounts on those days.

When I use the following formula I am able to sum the dollars

CASE WHEN `InventoryDate` = '10/1/2022' THEN `dollarsOnHand` ELSE 0 END

When I use the following formula I lose the ability to sum the column

CASE WHEN `InventoryDate` = MIN(MIN(`InventoryDate`)) OVER (PARTITION BY `PartNum`) THEN `dollarsOnHand` ELSE 0 END

I thought maybe a null value was the culprit, so I tried wrapping the formula in ifnull and return a 0 if null, but that didn't work either. Any ideas why I would lose the ability a aggregate with the min min value instead of the actual date value?


Thanks for any help!!

Answers