Is there a way to define own measure that count violations of the specific rule only?

We want to add in our quality gate a condition that limits a number of violations of one specific rule, it seems that for this purpose we should have to have a measure that counts such violations only - is it possible to define it and how?

SonarQube 7.1 Community