我正在努力向 POWER BI 中的 DAX CALCULATETABLE/SUMMARIZE 代码添加过滤器。不幸的是,我收到以下错误:
函数 SUMMARIZE 需要列名作为参数编号 6
我尝试了不同的过滤器,但没有成功,因为我不断收到相同的错误。
StudentAbsenceXXXX = CALCULATETABLE (
SUMMARIZE (
'Attendance2425',
'Attendance2425'[AdmissionNo],
'Students'[Year Group(s)],
"Student Sessions Present",
CALCULATE (COUNTROWS ( 'Attendance2425' ),'Attendance2425'[Mark Meaning] = "Present" || 'Attendance2425'[Mark Meaning] = "Educational Activity"),
FILTER(
'Attendance2425',
'Attendance2425'[Mark Meaning] = "Educational Activity"
)
))
理想情况下,我想使用字段“学生”[年级]应用相关表“学生”中的过滤器,但尝试了更简单的方法来尝试纠正第一个错误。
尝试使用变量来衡量:
StudentAbsenceXXXX =
VAR SessionsPresent =
CALCULATE(
COUNTROWS('Attendance2425'),
'Attendance2425'[Mark Meaning] = "Present" ||
'Attendance2425'[Mark Meaning] = "Educational Activity"
)
RETURN
CALCULATETABLE(
SUMMARIZE(
'Attendance2425',
'Attendance2425'[AdmissionNo],
'Students'[Year Group(s)],
"Student Sessions Present", SessionsPresent
),
FILTER(
'Attendance2425',
'Attendance2425'[Mark Meaning] = "Educational Activity"
)
)