filter a lookup field by distinct values in a field

filter a lookup field by distinct values in a field

I used the code below to filter a lookup field:

Lotvalue = Bulk_Inventory[Lot_Bulk = row.Lot_Ripper_Method_Data] sort by Added_Time desc;
row.Barrel_Reference_Ripper_Method_Data:ui.add(Lotvalue.ID.getall()); 

This code successfully filters my lookup field by all Barrel Reference transactions specific to the Lotvalue referenced above.

In order to make the dynamic picklist easier to use.  I would like to filter the lookup field by the most recent unique Barrel Reference.

For example, instead of getting a dynamic picklist like below:

434 April 7, 2017
434 January 5, 2017
434 December 12, 2016
576 May 24, 2017
576 February 2, 2017

I would like the following:
434 April 7, 2017
576 May 24, 2017

Any guidance would be gratefully appreciated.

Thank you,

Jeff