Forum Discussion
Anonymous
6 years agoNot applicable
Needing Help with DAX Statement
Background: I'm trying to create a denominator for Patients that have a Disease Diagnosis Date on or before the time they started taking the Drug. We want to make sure to only capture with high confi...
sturlaws
Resident Rockstar
6 years agoHi Anonymous,
could you see if this measure does the trick:
number of patients =
COUNTROWS (
GROUPBY (
FILTER (
GENERATE (
GENERATE (
VALUES ( Patient[PatientID] );
CALCULATETABLE ( VALUES ( Diagnose[diagnoseDate] ) )
);
CALCULATETABLE ( VALUES ( Drug[drugDate] ) )
);
Drug[drugDate] >= Diagnose[diagnoseDate]
);
Patient[PatientID]
)
)
I have not tested it thoroughly, just used the patient you provided + one I invented myself.
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.