what’s the best placement for "select all" option in multiple filer component?

While researching I found 2 main ways of placing the "Select all" option. One usually appears in the top right corner and another one (used ie by Microsoft it seems) is adding a Select all option on top of all filtering options. What’s the difference from the user perspective and which one is the best practice?
select all option on the top of filtering ooptions
select all on top right corner