My data view is look like below:
To do the SUM of salary group by employee id I have created 2 measure as below:
Measure = MAXX(DISTINCT(Employee1[EmployeeId]),MAX(Employee1[Salary]))
SumSalary = SUMX(DISTINCT(Employee1[Salary]),[Measure])
I tried as below but it does not work. Showing wrong values in Power BI.
SumSalary = SUMX(DISTINCT(Employee1[Salary]),MAXX(DISTINCT(Employee1[EmployeeId]),MAX(Employee1[Salary])))
Is there any other way to combine those measures?
I would try something along these lines:
TotalSalary = SUMX(
SUMMARIZE(Employee1,
Employee1[EmployeeId],
"EmployeeSalary", MAX(Employee1[Salary])),
[EmployeeSalary])
This first groups them by EmployeeId
, taking the maximum salary for that ID, and then sums the salaries for each employee.