Say I have some simple data like this:
If I'm setting up highlighting based on ID, I would make sure
this is a group based on this column, e.g.
Then, for the BackgroundColor property I would use an
=Switch(Count(Fields!ID.Value, "IDGroup") = 3, "Red"
, Count(Fields!ID.Value, "IDGroup") = 2, "Green")
So for each detail row, count the ID values in the ID
group and set the colour accordingly. Works for my data: