Count issues, which have specific transition only one time

Hi! I need some help with my task :slightly_smiling_face:
I want to create measure, that count number of issues, which have specific transition only one time .
I tried to filter issues by first transition date and last transition date, but have an error: “This measure need to do 22 iterations” or smth like this.