I have the following dax, designed to retrieve a value from another table in which key columns are shared.
BookingDate = CALCULATE (
FIRSTNONBLANK(FactSurgery[BookingDate], 1 ),
FILTER ( ALL (factsurgery),
factsurgery[PatientName] = clients[id]
&& FactSurgery[SurgeryStatus] = “Completed”
|| FactSurgery[SurgeryStatus] = “Completed - Prev. Rescheduled”) )
Here’s what I’m trying to accomplish:
Retrieve FactSurgery[BookingDate] in which the following 2 criteria are met:
(1) Factsurgery[PatientName] = dimclients[id]
AND
(2) FactSurgery[SurgeryStatus] = “Completed” OR FactSurgery[SurgeryStatus] = “Completed - Prev. Rescheduled”
I want the firstnonblank to return a match when Factsurgery[PatientName] = clients[id] but only when the surgery status is either “Completed” or “Completed - Prev. Rescheduled”. If the surgery status is anything other than these 2 values, I want the result to be blank.
Is this the right formatting?