The order is unimportant, you take both attacks
When you take the attack action, you can choose which of the attacks is the 'bonus' attack, and you choose when it occurs. Your are still taking the Attack action so you'll do both attacks.
This is directly supported by the rules on PHB page 189.
You choose when to take a bonus action during your turn, unless the
bonus action’s timing is specified, and anything that deprives you of
your ability to take actions also prevents you from taking a bonus
The timing is not specified. For an example of when the timing is specified, see the Monk's Flurry of Blows feature says, which specifies "after"
Immediately after you take the Attack action on your turn, you can
spend 1 ki point to make two unarmed strikes as a bonus action.
Related Q&A are here.
The polearem master has no restriction; when does not mean immediately after. If the Polearm Master feat had specified "immediately after" (as was done with the Monk) that would be different. Such required sequencing was not specified.
Some notes on RAI and the confusion
That Jeremy Crawford has waffled on how the choice of when to take your bonus action influences feats like Shield Master (after two years of adhering to the original basis) is an unfortunate case of putting the twit into Twitter and thereby abandoning the core guidance for this edition of using plain English to interpret the rules.
His original point on sequencing was made back in 2015.
Jan 21, 2015
As with most bonus actions, you choose the timing, so the Shield Master shove can come before or after the Attack action.
Two years later, for whatever reason, he changed his mind but the real problem with his waffling is that the rules as written allow for the choice of what happens in the combat turn - when you apply your bonus action - unless otherwise specified. (An interesting analysis of that is here).
So what do I do?
This brings us back to "rulings versus rules" - I suggest that you work with your DM and arrive at that which makes the most sense at your table. And once the DM rules on it, go with that and don't look back. If you have read a lot of J Crawford tweets over the years, as I have, you'll find a common refrain from him along the lines of: whatever gives you the most joy at your table. Work with your DM.