First off I realize that narrow fact tables are the ideal situation.
I am designing a healthcare data warehouse specifically for ingestion into Power BI. The problem I'm having is that I have over 100 different metrics that are included in just one report. Most of the data comes from the source like this:
Hospital | HospitalID | Date | Description | Number |
---|---|---|---|---|
Children's Hospital | 20192 | 1/2/2021 | Beds Needed | 8 |
Children's Hospital | 20192 | 1/2/2021 | Covid Patients | 2 |
We currently use logic to pull each metric out like this in PowerBI:
Beds Needed=IF(Description="Beds Needed", Number,0)
We do this for over 100 metrics that are needed according to business leaders. My question is, there are two ways Im thinking of doing this:
Option 1:
We put the logic like above into the database and have every metric be it's own column.
Date | Hospitalid | Beds Needed | Covid Patients |
---|---|---|---|
1/2/2021 | 20192 | 8 | 2 |
Option 2:
I setup the fact table like so:
Date | HospitalID | Descriptionid | Number |
---|---|---|---|
1/2/2021 | 20192 | 12 | 8 |
1/2/2021 | 20192 | 11 | 2 |
And then create a dimension table like so:
Description | DescriptionID |
---|---|
Beds Needed | 12 |
Covid Patients | 11 |
The tables that I have currently (in the format of the first table) each are around 200k rows and there are 4 of them. There is one table that supplies metrics that is around 20 million rows.