Hi Anitha,
1. Add the class in row shelf.
2. Add the grade in column shelf.
3. Add the Students in text shelf and use count aggregation. Now add quick calculation -> % of total and select across the table.
4. You can now find % of students for grade against each class and compare them.
Hope it helps you.