Good point Steven! I am in the process of updating the docs to use your expression in place of mine. I am thinking of writing the following. Can you review it for me?
Preventing Duplicate Values:
You can ensure that every record in a table has a unique field value by specifying a Valid_If expression for that field.
=NOT(IN([_THIS], SELECT(Customers[State], NOT(IN([CustomerId], LIST([_THISROW].[CustomerId]))))))-- when used as the ValidIf condition for field State, it ensures that every customer has a unique value for State. In this example, we assume that CustomerId is the key for the Customers table.
This expression uses [_THISROW].[CustomerId] to obtain the key value of the current row. This allows you exclude the current record from the list of records having duplicate field values. This makes it possible for you to update the current record without reporting it as a duplicate field value.