Forum Discussion
Excluding patients
I am fairly new to Power BI, so I am sure this is easy for some of you, but I am struggling! 🙂 I am needing to create a report of patients with a certain BMI and race but exclude the patients that have a certain disease/diagnosis. I have been able to figure out how to get my subset by BMI and Race, but when I try to filter out the patients with a particular disease/diagnosis it only excludes those identified diagnosis codes, it does not remove the patient because the patient has had other diagnoses.
2 Replies
- amitchandakSuper User
cfindling , depending on the data model you might have create a flag or get such a list
example measure =
var _tab = summarize(filter(table, Table[disease] in {"A","B","C"}), Table[patient])
return
calculate(count(Table[patient]), filter(Table, not( Table[patient] in _tab)))
- AnonymousNot applicable
Hi cfindling,
I think 'IN' operator should suitable for you requirement, you can create a variable to filter these patients table with particular diagnoses to extract the patient list and use it as filter conditions.
The IN operator in DAX - SQLBI
Can you please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng