我的数据视图如下所示:
按员工ID执行工资组的SUM我创建了2个度量如下:
Measure = MAXX(DISTINCT(Employee1[EmployeeId]),MAX(Employee1[Salary]))
SumSalary = SUMX(DISTINCT(Employee1[Salary]),[Measure])
我尝试如下,但它不起作用。在Power BI中显示错误的值。
SumSalary = SUMX(DISTINCT(Employee1[Salary]),MAXX(DISTINCT(Employee1[EmployeeId]),MAX(Employee1[Salary])))
还有其他方法可以合并这些措施吗?
答案 0 :(得分:0)
我会尝试这些方法:
TotalSalary = SUMX(
SUMMARIZE(Employee1,
Employee1[EmployeeId],
"EmployeeSalary", MAX(Employee1[Salary])),
[EmployeeSalary])
首先按EmployeeId
对它们进行分组,获取该ID的最高工资,然后将每位员工的工资加起来。