Filter and Group by using Power Query or Excel formula?
Let’s say I want to calculate average annualized salary over my company.
My data set is
Department | Employee Number | Salary Grade | Annualized Salary | FTE %
Someone can work 60% on a level 1 salary for department A and 40% on a level 2 salary for department B. In the dataset this person has 2 rows.
There are two metrics I want to calculate:
- average annualized salary across the whole company
- average annualized salary across the whole company excluding department B
For 1 - that employee’s annualized salary need to be recalculated as 60% * lvl1 + 40% lvl 2 to get one row per employee
For 2 - I filter out all department B salaries so that employee’s annualized salary is simply their lvl 1 salary
Question: Should I:
Create two tables in power query, filter out department B in one table using Power Query, group by employee number for both tables in power query, output both queries as tables in excel, create 2 pivot tables to calculate averages
OR
- Use excel formulas to do everything: filter and group by and calculate 2 averages
[link] [comments]
Want to read more?
Check out the full article on the original site