Linq query to filter data table

in general, we do have some doubts when comparing the description and the LINQ

we don’t see such a check implemented

can maybe rewritten to

let mr = grp.OrderBy(Function (g) CDbl(g(1).toString.Trim)).Last()
Let ra = new Object(){a1, mr(1), a2, mr(3)}
Select r = .....

we order the group on UOM an taking from the row with max UOM later the values

Instead of CopyTo DataTable have a look here for a more defensive handling of empty results:

In case you need more help then we would ask to provide more cases / samples especially where the

if the value in column 1 and value in column 3 are the same it is considered duplicate.

case is reflected