I have seen a different approach used in some of the Youtube videos on the QuickSight channel.
Weighted Salary = Salary/countOver({Customer Name}, [{Customer Name}], PRE_AGG)
Total Salary = sumOver({Salary_weighted}, [], PRE_AGG)
Distinct Customers = distinctCountOver({Customer Name}, [], PRE_AGG)
Average Salary = {Total Salary}/{Distinct Customers}
Are there are any particular reasons why you would choose one approach over another?