Count zeros not nulls - dax measure

Good morning ,

Could I please ask for help regarding my current task . I need DAX formula for my requirements but don’t really know make it work.
I have to create 2 measures:
count drivers seen within 7 days from incident ( 0 days included) and count drivers not seen ( blank cells in my table)


This measure is my problem , because it counts blanks as well and I don’t want it because blanks say, that drivers was not seen at all .

Driver seen within 7 days =
CALCULATE(
COUNTROWS(
FILTER(FACT_INCIDENT, FACT_INCIDENT[DAYS_TO_SEE_DRIVER]<=7)),
FILTER(FACT_INCIDENT, FACT_INCIDENT[CATEGORY] = “Collision” || FACT_INCIDENT[CATEGORY] = “Collision – Major” || FACT_INCIDENT[CATEGORY] = “Collision – Minor” || FACT_INCIDENT[CATEGORY] = “Employee Injury” || FACT_INCIDENT[CATEGORY] = “Assault – Physical (Emp.)”|| FACT_INCIDENT[CATEGORY] = “Assault – Spitting (Emp.)”|| FACT_INCIDENT[CATEGORY] = “Assault – Verbal (Emp.)”|| FACT_INCIDENT[CATEGORY] = “Passenger Incident”))

How can I modify this measure not to count blank but only 0-7 days ?

Would be grateful for help,

Iwona

Hi @Iwona ,

Would replacing “COUNTROWS” with COUNTA(xxx[DRIVER_FIRST_SEEN] solve the problem, leaving the rest of the measure the same ? (Assuming “DRIVER_FIRST_SEEN” is a data-column, not a measure)

Kind regards, Jan van der Wind

Many thanks Jan , your input has saved my life :slightly_smiling_face:

Regards,

Iwona