Hi Max, this is a GREAT question!! Like Anthony, I would probably try something in Sheets before I tried to do it in Looker Studio (mostly to avoid blending 🤣). BUT if you really needed/wanted to do it in Looker Studio, here's my suggestion: You could use blending to pull out only the enrollment on the max date of each year-month combo.
In your data source (Resource > Manage added data sources), click the 3 dots and Duplicate the CalendarDate field, name it Year-Month CalendarDate, and change the type to Year-Month.
Then, under Resource > Manage Blends, you can blend your data source on itself to do what you're looking for as follows. Basically, it's a left join where you are ONLY looking to return the Max calendar date (on the left) for each Year-Month and Grade combination, and its associated TotalEnrollment on that date.
The resulting blended data source will have the following fields:
- Calendar Date
- gradelevel
- TotalEnrollment
- Year-Month Calendar Date
You can then use either CalendarDate or Year-Month CalendarDate as your dimension for your chart, depending how you want it to display.
I'm sure there are other ways to do this too that avoid blending, but this seems to work well!
Laura