我正在尝试创建一种将对下表中的值进行计数的度量。如何计算至少包含一个任务和日期的项目?如何计算至少包含两个任务和日期的项目?
奖金问题:如何计算至少执行一项任务且没有日期(空)的项目,如何计算完成两项任务且没有日期的项目?
答案 0 :(得分:1)
以下4种措施适合您-
1。
one_one =
var count_task_1 = IF(min(project_count[task 1]) <> BLANK() && MIN(project_count[date 1]) <> BLANK(),1,0)
var count_task_2 = IF(min(project_count[task 2]) <> BLANK() && MIN(project_count[date 2]) <> BLANK(),1,0)
var count_task_3 = IF(min(project_count[task 3]) <> BLANK() && MIN(project_count[date 3]) <> BLANK(),1,0)
RETURN
IF(
(count_task_1+count_task_2+count_task_3) >= 1,
1,
0
)
2。
two_two =
var count_task_1 = IF(min(project_count[task 1]) <> BLANK() && MIN(project_count[date 1]) <> BLANK(),1,0)
var count_task_2 = IF(min(project_count[task 2]) <> BLANK() && MIN(project_count[date 2]) <> BLANK(),1,0)
var count_task_3 = IF(min(project_count[task 3]) <> BLANK() && MIN(project_count[date 3]) <> BLANK(),1,0)
RETURN
IF(
(count_task_1+count_task_2+count_task_3) >= 2,
1,
0
)
3。
one_no_date =
var count_task_1 = IF(min(project_count[task 1]) <> BLANK() && MIN(project_count[date 1]) = BLANK(),1,0)
var count_task_2 = IF(min(project_count[task 2]) <> BLANK() && MIN(project_count[date 2]) = BLANK(),1,0)
var count_task_3 = IF(min(project_count[task 3]) <> BLANK() && MIN(project_count[date 3]) = BLANK(),1,0)
RETURN
IF(
(count_task_1+count_task_2+count_task_3) >= 1,
1,
0
)
4。
two_no_date =
var count_task_1 = IF(min(project_count[task 1]) <> BLANK() && MIN(project_count[date 1]) = BLANK(),1,0)
var count_task_2 = IF(min(project_count[task 2]) <> BLANK() && MIN(project_count[date 2]) = BLANK(),1,0)
var count_task_3 = IF(min(project_count[task 3]) <> BLANK() && MIN(project_count[date 3]) = BLANK(),1,0)
RETURN
IF(
(count_task_1+count_task_2+count_task_3) >= 2,
1,
0
)
这是输出-
您可以使用这些逻辑进行其他必要的计算