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
Anonymous
Not applicable

How to transform m to n relations and time series to star schema data

Hello clever people

I have a problem with transforming time series data into a star schema. What is the best solution? The fact table will consist of master data on PatientID. I want to be able to - on any given date to tell where the patient is hospitalized and which drug(s) they were prescripted.

My test data looks like this:

Table 1: Hospitalization    Table 2: PrescriptionDrug   
PatientIDHospitalCityHospitalizationStartDateHospitalizationEndDate PatientIDPrescriptionDrugPrescriptionStartDatePrescriptionEndDate

1

Copenhagen12-aug-1715-aug-17 1Vicodin01-feb-1715-sep-17
1Stockholm27-sep-1714-dec-17 1Levoxyl10-maj-1731-dec-99
1

Berlin

09-jan-1816-feb-18 2Lipitor10-okt-1612-aug-19
2Stockholm22-apr-1823-apr-18 2Vicodin10-okt-1612-aug-19
2Berlin31-aug-1914-sep-19 2Amoxil10-okt-1625-nov-18
3Copenhagen02-apr-1816-maj-18 2Delasone03-apr-1715-sep-17
3Oslo05-nov-1819-dec-18 2Zestril19-aug-1931-dec-99
3Berlin03-sep-1909-sep-19 3Amoxil03-sep-1920-okt-19

 

1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

here is how I would have done it: sample

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

View solution in original post

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

here is how I would have done it: sample

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

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.