Averaging Sales department salaries with CALCULATE and a department filter
You have a Power BI model that contains a table named Employees. The table contains the following columns: • Employee ID • First Name • Last Name • Department • Salary Each employee is uniquely identified by using Employee ID. You need to create a DAX measure that will calculate the average salary of all the employees in the sales department. Which DAX expression should you use?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The pattern is CALCULATE over an aggregate with a filter argument — CALCULATE(AVERAGE(Salary), Department = "Sales") swaps the filter context to the sales department before averaging.
An Employees table lists staff by ID, name, department, and salary, and a measure must return the average salary of employees in the sales department only.
Using DISTINCTCOUNT to answer an average question — counting distinct salaries measures salary variety, not the mean pay of the department's employees.
Community Discussion (8 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
CALCULATE evaluates its first argument in a modified filter context: the boolean filter Employees[Department] = "Sales" restricts the table to sales-department rows, and AVERAGE(Employees[Salary]) then computes their mean salary. This is exactly the requested measure — the department-scoped average — expressed in the standard DAX filter pattern.Why the Other Options Are Wrong
DISTINCTCOUNT(Employees[Salary]) (A) counts how many different salary values exist across all departments, with no department filter and no averaging. Option B counts distinct salary values within the sales department — better scoped, but still a count, not an average. AVERAGE(Employees[Salary]) (D) averages across every department in the model, ignoring the sales-only requirement.Community Comment Notes
A commenter notes DISTINCTCOUNT in options A and B merely counts how many different salaries exist, never an average, and option D ignores the department restriction. The unanimous vote lands on C.Official Reference
Related Analysis
Practice All PL-300 Questions
Access 116 questions with complete answers and detailed explanations.
View Full PL-300 Practice Test →