Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi everyone,
I have a dataset of Patient ID's and the Drugs they have been prescribed, and the Month prescribed.
I'd like to create (a measure?) that tells me:
How many patients were prescribed 2 or more drugs each month
How many were prescribed 2 or more excluding Methadone each month
How many were prescribed Methadone and 1 other each month
I've tried a few things like count distinct and summarizing the table but can't quite figure it out. Would be very greateful to anyone who can suggest anything!
My dataset looks like this:
Patient ID | Event staff type | Drug_Name | Month_Number | Month |
30408763 | General Medical Practitioner | Amitriptyline | 4 | April |
16092666 | Nurse Access Role | Mirtazapine | 8 | August |
16092666 | Nurse Access Role | Codeine | 8 | August |
16092666 | Nurse Access Role | Diazepam | 8 | August |
52211931 | Nurse Access Role | Amitriptyline | 10 | October |
52211931 | General Medical Practitioner | Amitriptyline | 1 | January |
52211931 | Pharmacist | Amitriptyline | 9 | September |
52211931 | General Medical Practitioner | Amitriptyline | 7 | July |
52211931 | Technician - PS&T | Amitriptyline | 8 | August |
52211931 | General Medical Practitioner | Amitriptyline | 10 | October |
52211931 | Associate Practitioner | Amitriptyline | 11 | November |
52211931 | Nurse Access Role | Amitriptyline | 12 | December |
52211931 | General Medical Practitioner | Methadone | 12 | December |
52211931 | General Medical Practitioner | Amitriptyline | 1 | January |
22242833 | Nurse Access Role | Amitriptyline | 2 | February |
22242833 | General Medical Practitioner | Amitriptyline | 3 | March |
51635024 | General Medical Practitioner | Amitriptyline | 5 | May |
51635024 | Technician - PS&T | Nefopam | 7 | July |
51635024 | General Medical Practitioner | Methadone | 8 | August |
51635024 | General Medical Practitioner | Amitriptyline | 6 | June |
51635024 | Nurse Access Role | Amitriptyline | 7 | July |
53880227 | Nurse Access Role | Amitriptyline | 1 | January |
4286424 | Pharmacist | Amitriptyline | 10 | October |
4286424 | Technician - PS&T | Amitriptyline | 11 | November |
4286424 | Technician - PS&T | Oxycodone | 12 | December |
4286424 | Nurse Access Role | Amitriptyline | 1 | January |
18610202 | Nurse Access Role | Diazepam | 5 | May |
18610202 | Nurse Access Role | Diazepam | 5 | May |
1237970 | Nurse Access Role | Methadone | 8 | August |
18610202 | Nurse Access Role | Diazepam | 4 | April |
Solved! Go to Solution.
Please try these expressions to get the result shown.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try these expressions to get the result shown.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Wow Pat thank you so much! This has worked a treat 🙂 I don't think I would have ever got that!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |