The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I currently have two datasets. One dataset contains the number of patients who completed a program. The dataset includes the patient ID, and date of contact with the program. A patient might have several contacts with the program and at different days, and so each contact is presented in a separate row.
The other data set includes emergency department (ED) attendance and contains patients' IDs and dates of attendance.
I am interested in linking the two datasets and extracting the number of patients who attended ED before (one year), during and after completing the program (one year).
Any advice on how to set up this?
Thanks
Hi @Sonya_Zam ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Below is a sample of the data of the program data and ED data.
PatientID | Contact No. | StartProgram | EndProgram |
A001 | 1 | 01/12/2010 | 05/12/2010 |
A001 | 2 | 01/12/2010 | 05/12/2010 |
A001 | 3 | 01/12/2010 | 05/12/2010 |
B001 | 1 | 07/08/2016 | 07/09/2016 |
B001 | 2 | 07/08/2016 | 07/09/2016 |
B001 | 3 | 07/08/2016 | 07/09/2016 |
C001 | 1 | 07/08/2017 | 07/09/2017 |
D001 | 1 | 07/08/2014 | 14/08/2014 |
D001 | 2 | 07/08/2014 | 14/08/2014 |
A001 | 1 | 11/08/2022 | 11/08/2022 |
E001 | 1 | 12/02/22 | Still going |
ED data
PatientID | ED_Date |
A001 | 06/08/2010 |
C001 | 08/06/2017 |
C001 | 02/01/2021 |
F001 | 08/08/2019 |
D001 | 07/09/2014 |
For example, A001 attended ED five months before starting the intervention program. D001 attended ED one month after finishing the program.
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
181 | |
88 | |
71 | |
48 | |
46 |