cancel
Showing results for 
Search instead for 
Did you mean: 

Patient Cohort (AND Slicer)

Super User
722 Views
Highlighted
Super User
Super User

Patient Cohort (AND Slicer)

In the healthcare field, it is often desireable to identify a cohort of patients with similar, multiple diagnoses. This quick measure returns a comma-delimited list of patients that have all been identified with the same diagnoses. The tricky part here is that this allows the user to select from a slicer the diagnoses for which the user is interested in obtaining a cohort. Identified patients have had diagnoses that meet all of the selected criteria. In other words, all patients have had diagnoses for all of the selected diagnoses in the slicer. Essentially creates an AND for the slicer as opposed to the normal OR.

 

 

Cohort = 
VAR tmpTable1 = GENERATE(VALUES(Diagnosis[Patient]),
                         EXCEPT(
                                VALUES(Diagnosis[Diagnosis]),
                                CALCULATETABLE(VALUES(Diagnosis[Diagnosis]))))
VAR tmpTable2 = SUMMARIZE(tmpTable1,Diagnosis[Patient])
VAR tmpTable3 = EXCEPT(VALUES(Diagnosis[Patient]),tmpTable2)
RETURN CONCATENATEX(tmpTable3,[Patient],",")

This quick measure would take two inputs, the column for the ID to return (Patient) and the column for the slicer selection (Diagnosis)

 

 

Also included is the trivial variation, Count of Cohort:

 

 

Count of Cohort = 
VAR tmpTable1 = GENERATE(VALUES(Diagnosis[Patient]),
                         EXCEPT(
                                VALUES(Diagnosis[Diagnosis]),
                                CALCULATETABLE(VALUES(Diagnosis[Diagnosis]))))
VAR tmpTable2 = SUMMARIZE(tmpTable1,Diagnosis[Patient])
VAR tmpTable3 = EXCEPT(VALUES(Diagnosis[Patient]),tmpTable2)
RETURN COUNTROWS(tmpTable3)

 

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!