NoActionTakenApprovalTasks = SUMMARIZE(DimApprovalTasks,
DimApprovalTasks[Approver],
DimApprovalTasks[ApprovalRole],
"Total Tasks", countrows(DimApprovalTasks),
"Total No Action Taken Tasks", IF(
CALCULATE(COUNTROWS(DimApprovalTasks), DimApprovalTasks[Status]= "No Action Taken")= BLANK(),
0,
CALCULATE(COUNTROWS(DimApprovalTasks), DimApprovalTasks[Status]= "No Action Taken")
)
)
In this example, we add an IF condition to return either 0 or value if not empty. This will be same to create measure to ensure value set to 0 when empty value returned. An example is below.
Total Approved Tasks =
IF(
CALCULATE (
COUNTROWS ( DimApprovalTasks ),
DimApprovalTasks[Status]= "Approved"
) = BLANK(),
0,
CALCULATE (
COUNTROWS ( DimApprovalTasks ),
DimApprovalTasks[Status]= "Approved"
)
)
No comments:
Post a Comment