yes you can. make sure you apply for multi-entry visa instead of single entry.
the tricky bits would be the validity of the the visa itself. if you got visa that expire before the second trip (despite being multi-entry), of course you need to apply for another one.
what I'm suggesting: submit the details of both trips (itineraries, hotel booking, and airticket-if you have purchased it) so you they can see your plans in advance and issue longer validity visa.
for data point, I had multi-entry Schengen visa issued by Italian embassy with 35 days of validity and 20 days of maximum stay. every member of EU should have different policies for how long they give the visa validity.
be sure to apply in the embassy of the country you plan to travel the longest.