How to get monthly pageviews programatically? Preferably using Data Explorer

Got one more question actually. Maybe that won’t be much of a hustle.

Is there a way to get the results in following format so using sum: