count function not working

count function not working

I am trying to use 2 criteria in a count function to see if there are any items 1) with the same po as the current item AND 2) if the items aren't marked "Received"

I am doing this because I would like to update the po to "complete", if all of the items have been received

I first tried to fetch records, create a list, then see if the list was empty but it wouldn't let me

So then I tried a count function, and if the count function returns == 0 then I will update the order

But everything is satisfying my criteria (and thus all my orders are showing up as "complete") while clearly that's not the case.

if (count(Order_Detail_Data[(PurchaseOrderID == orderDetailRecord.PurchaseOrderID && Status != "Received")])  ==  0)
    {
        completePoRecord  =  Purchase_Order  [ID == orderDetailRecord.PurchaseOrderID];
        completePoRecord.Order_Status = "Complete";
    }

Where Order_Detail_Data is the form holding all of the item and orderDetailRecord is the collection variable for the current record

I'm willing to try a different method, but the count function seems like the most straight forward

Please advise.

P.S. I'm having a lot of issues with the != operator.  It could be what's the problem above.  I have one criteria for the view "Receiving_View", (Status != "Received"), and only one of a hundred records shows up, mind you only a handful are received.