Reply
jpvernon67
Frequent Visitor
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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.

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)