Unique line items in a table

You could use agg model as a condition to a basic model. In the agg model, set your conditions as desired and group by City and Id.

In your basic model, set the condition on Id to be “in” the agg model id values.