Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.