cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jpvernon67
Frequent Visitor

Time from hospital discharge to first follow up appointment

Relatively new to DAX and I am struggling to get my head around the solution to this problem. I have searched for a solution but nothing seems to fit,

 

I have 3 tables:

 

Patient provide this has the unique client ID in it

 

Hospital discharge table has the unique client ID, discharge date. Has many values for the same client ID - I have no control over this table. Comes from the hospital.

Schedule data also has the client ID, appointment dates, appointment types. This also has many fields.

There is no direct link other than client ID between these 2 tables. i.e there is no 'event ID' that would connect it to the associated follow up appointment.

 

What I need to get is the number of days from the patient's discharge date to the first outpatient appointment date (can't be the same day)

 

The results would look something like this:

Client IDDischarge DateFollow Up DateDays
1123451/1/20221/5/20224
432354/1/20224/7/20226
5326233/12/20223/14/20222
644522/14/20222/18/20224
4267783/11/20223/20/20229
  Median Days4

 

What I need for the report is the row total days and the aggregate median days per period FY, FYQ,...

 

Any insight would be very appreciated

3 REPLIES 3
jpvernon67
Frequent Visitor

Sorry about that

 

here is a link to the files:

 

https://1drv.ms/u/s!AptRNMy-TRKq4wvd6mrjQTUyIacP?e=y2mWAY

 

Here is what the output should look like:

PatientIDEventDischarge DateFollow Up DateDays
54918Emergency Discharge4/17/20214/28/202111
55069Emergency Discharge4/17/20214/26/20219
55079Emergency Discharge4/17/20214/22/20215
40509Emergency Discharge4/19/20214/29/202110
42195Emergency Discharge4/19/20214/28/20219
15283Inpatient Discharge01/31/2022  

 

it is also possible that the person did not have a follow up appointment like patient 15283. I should be able to get the median days to follow up by both patient and as an aggregate by time period.

Shishir22
Solution Sage
Solution Sage

Hello @jpvernon67 ,

 

Request you to please provide sample data of all the tables and expected result so that we can help you.

 

Thanks,

Shishir

Cheers,
Shishir

here is a link to the files:

 

https://1drv.ms/u/s!AptRNMy-TRKq4wvd6mrjQTUyIacP?e=y2mWAY

 

Here is what the output should look like:

PatientIDEventDischarge DateFollow Up DateDays
54918Emergency Discharge4/17/20214/28/202111
55069Emergency Discharge4/17/20214/26/20219
55079Emergency Discharge4/17/20214/22/20215
40509Emergency Discharge4/19/20214/29/202110
42195Emergency Discharge4/19/20214/28/20219
15283Inpatient Discharge01/31/2022  

 

it is also possible that the person did not have a follow up appointment like patient 15283. I should be able to get the median days to follow up by both patient and as an aggregate by time period.

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors