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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.