Healthcare Risk Factors Analytics
A 7-page Power BI report on 30,000 patient records, built from scratch. It asks who stays longest in hospital and why, cleans a deliberately messy file in Power Query without dropping a row, and finds 2,844 patients who may have undiagnosed diabetes.

The problem
A hospital planning beds needs to know which patients stay longest and what drives it: the condition, the clinical readings or lifestyle. The Healthcare Risk Factors dataset (Kaggle) has 30,000 patient records with age, gender, condition, blood tests, vitals, lifestyle scores and length of stay. The file is synthetic and deliberately dirty, so cleaning it is part of the job.
Data cleaning
The raw file has 20 columns, and only 45% of its rows are complete. Dropping incomplete rows would have thrown away 55% of the patients, so every fix is a Power Query step that reruns on refresh:
- Missing values: 22,500 in total. Gender and condition are labelled “Not recorded” so they stay visible; age, glucose and blood pressure are left empty so averages use only real readings.
- Impossible values: 3,397 fixed. Oxygen above 100% was capped at 100%, stress, diet and activity scores were clipped to their scales, and BMI under 12 or negative triglycerides were set to empty.
- Junk columns: 2 removed (placeholder text and random numbers).
A Data Quality page shows every issue, how many rows it touched and how it was fixed, counted live from the source file.
Design and interactivity
- A navy sidebar with page navigation, synced filters and a reset button
- One KPI tile per measure with an icon and a coloured accent
- A metric switcher (field parameter) that changes the charts between average stay, long-stay rate, bed days and patients, with chart titles that follow the switch
- Bars coloured against the average: coral for 1.5× the average or more, amber above average, blue below
- A drill-through page that lists the patients for any condition
- A designed tooltip with a dynamic title, the stay compared with the average, a status badge and a stay-length chart
What’s in the report
Overview: who stays longest, by condition, age band and gender, plus the spread of stay lengths and the share of long stays (8+ days) per condition.
Clinical: a profile of each condition (glucose, HbA1c, blood pressure, BMI, oxygen, cholesterol), stay by clinical band, and the diabetes screening gap.

Lifestyle: stay by stress, sleep, diet and activity, and a check of whether lifestyle still matters once the condition is fixed.

Data Quality: the cleaning log and the rules behind it.

Insights & Actions: an executive summary, six findings, and actions for bed planning, clinical teams and prevention.

Key insights
- The condition decides the stay: cancer patients stay 13.0 days on average, diabetes patients 5.5 and healthy patients 1.5, against 4.4 overall.
- Two conditions fill the long stays: every recorded stay of 8+ days is a cancer or diabetes patient. 92% of cancer stays last 8 days or more, and diabetes alone uses 27% of all bed days.
- Vitals flag longer stays: patients with oxygen under 92% stay 5.3 days vs 4.1; diabetic-range HbA1c means 5.3 days vs 3.6.
- Lifestyle predicts the illness, not the stay: patients with 4+ risk factors stay 5.1 days vs 3.4 with 0-1, but within each condition the gap disappears.
- A screening gap: 2,844 patients have an HbA1c of 6.5 or more but are recorded under hypertension, obesity, cancer, arthritis or asthma.
Outcome
Bed planners can size oncology capacity around a 13-day stay rather than the 4.4-day average, and clinical teams get a list of patients to offer a diabetes test. The report is clear about its limits: the data is synthetic, has no dates, and shows associations, not causes.