Forum Discussion
AgeOfEgos
Helper I
7 years agoConditional column based on different rows (same Person_ID)
I want a list of patients that take 2 (Or more) medication types at the same time. The table would be; Name Benzos____________Opioids___________Medication Patient A ...
AkhilAshok
Solution Sage
7 years agoWhy don't you create a measure for Medication # = DISTINCTCOUNT(Table[Medication]) and use this as a Visual Level filter greater than 2? If your visual has other dimensions which breaks the group by, you could ignore those as well:
Medication # Name Level =
CALCULATE (
DISTINCTCOUNT ( Table[Medication] ),
ALLEXCEPT ( Table, Table[Name] )
)
AgeOfEgos
Helper I
7 years agoIf they have two opiods, wouldn't that still appear? IE
Patient A Lortab 1
Patient A Lortab 2
MedicationCount > 2 would be satisfied? I"m needing the specific combination of a benzo + opioid