Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I am trying to get compliance whether the patient took a drug screen or not. Here are some example data:
For clinic A the compliance is 87.5%, 7 (number of distinct patients who took a drug screen)/8 total number of distinct patients in clinic A. For clinic B the compliance is 50% (1/2).
Is there a way to do this with dax? Please reach out if you need additional information.
Solved! Go to Solution.
@ranis1227 , try measure
Divide(calculate(sum(Table[patients]), filter(Table, Table[drugscreen] = "Y")),sum(Table[patients]))
Hi @ranis1227 ,
You may try this Measure.
compliance =
VAR PatientsWithGrugScreen =
CALCULATE (
[Distinct Count Patients],
FILTER ( DrugScreen, DrugScreen[GrugScreen] = "Y" )
)
VAR ClinicPatients =
CALCULATE ( [Distinct Count Patients], VALUES ( DrugScreen[Department] ) )
RETURN
DIVIDE ( PatientsWithGrugScreen, ClinicPatients )
The result looks like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Thank you very much. This works perfectly.
@ranis1227 , try measure
Divide(calculate(sum(Table[patients]), filter(Table, Table[drugscreen] = "Y")),sum(Table[patients]))
Amit,
I tried it and it worked for the sum of total patients.
However, I need it for the distinct number of patients. I used
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
76 | |
50 | |
46 | |
16 | |
12 |