I am basically looking for a way to find a count of schools that are out performing any school based on two fields.

Year

Content

Test level

School Name

FRM %

Pass %

2016-17

English

All

School A

90%

40%

2016-17

English

All

School B

90%

50%

2016-17

English

All

School C

80%

60%

2016-17

Math

All

School A

90%

55%

2016-17

Math

All

School B

90%

30%

2016-17

Math

All

School C

80%

60%

So for School A in English, I would need an equation that tells me there is 1 school with the same FRM% that has a higher Pass %. So for School A in Math, there are 0 schools with the same FRM% that has a higher Pass %.

I can write an LOD that gives me the number of schools with the same FRM% as whatever school ( {fixed [School Year],[Content Area],[Test Level],[Frm %]:SUM([Number of Records])} ), but I just cant figure out how to search that subset of schools by score to determine which of the schools have a better pass rate. Who has the same FRM % as me, but has a better Pass%.

Bonus points if you know how to make the "Same FRM% as me" into "my FRM % plus or minus a few points".