Forum Discussion
Anonymous
4 years agoNot applicable
SUMMARIZE returning errors (cannot convert to scalar value)
I have an employee directory that lists every employee in the company, along with the office they are assigned to. I need to provide a measure that tells us what percentage of our offices have 10 or ...
- 4 years ago
The SUMMARIZE function returns a table, but measures must return scalar values. That's why you get the error.
Here's a measure to get the number of offices with more than 10 employees
Offices >10 Employees = VAR _SelectedNumEmployees = 10 VAR _Result = COUNTROWS( FILTER( VALUES('Employee Directory'[Office - Assigned]), CALCULATE(COUNT('Employee Directory'[Employee ID])) > _SelectedNumEmployees ) ) RETURN _ResultYou could replace CALCULATE(COUNT('Employee Directory'[Employee ID])) in the above with a measure that counts number of employees.
Anonymous
4 years agoNot applicable
PaulOlding Aha, that worked, thank you so much!! I guess I need to learn more about the VAR function.