To implement this recipe, do the following:
- Create the following measure:
Cohort =
VAR __Table =
GENERATE(
DISTINCT('R03_Table'[Patient]),
EXCEPT(
DISTINCT('R03_Table'[Diagnosis]),
CALCULATETABLE(DISTINCT('R03_Table'[Diagnosis]))
)
)
VAR __Table2 = SUMMARIZE(__Table,[Patient])
VAR __Table3 = EXCEPT(DISTINCT('R03_Table'[Patient]),__Table2)
RETURN
CONCATENATEX(__Table3,[Patient],",")
- On a Report page, create a slicer visualization and place the Diagnosis column into the Field area of the visualization.
- On the same Report page, create a card visualization and place the Cohort measure into the Fields area of the visualization.
- Choose two or more diagnosis codes in the slicer by using the Ctrl key to select multiple items and note how the card values in the card visualization change.
The card visualization is displaying only those patient IDs that have been diagnosed with all of the diagnosis codes that were chosen in the slicer. For example, if you choose diagnosis codes F91 and K78, you will note that only a single patient is displayed, 168947287. If you additionally select K85, the card visualization displays (Blank), indicating that no patient has been diagnosed with code F91 and F78 and K85.