Real-Life Hospital Example
The billing team flags that some appointment_time values look inconsistent and treatment costs aren’t displaying as currency in a demo report. You’re asked to clean the source data before anyone builds visuals on top of it.
Practical Exercise (Hands-On)
In Power Query, set appointment_date, bill_date, and treatment_date to Date type, set amount and cost to Fixed Decimal Number, trim text columns like address and reason_for_visit, and rename cryptic column headers to business-friendly names.
Step-by-Step
⚠️ Caution: This lab was developed using Microsoft Power BI Desktop v2.155.756.0 (64-bit). If you are using a different version, you may notice minor differences in the menus, icons, or interface. The overall functionality and steps should remain largely the same.
- Click Get Data > Text/CSV and import appointments.csv, choosing Transform Data instead of Load so it opens directly in Power Query Editor.
- Repeat Get Data > Text/CSV > Transform Data for billing.csv, doctors.csv, and treatments.csv.
- In the Queries pane, click the appointments query.
- Select the appointment_date column, go to the Transform tab, click Data Type, and change it to Date.
- Select the appointment_time column and set its Data Type to Time.
- Right-click the reason_for_visit column header > Transform > Trim to remove stray leading/trailing spaces.
- Switch to the billing query. Select amount and set Data Type to Fixed Decimal Number.
- Select bill_date in the billing query and set Data Type to Date.
- Switch to the treatments query. Set cost to Fixed Decimal Number and treatment_date to Date.
- Switch to the doctors query and confirm years_experience is set to Whole Number.
- Review the Applied Steps list on the right of each query to confirm your changes were captured in order.
- Click Home > Close & Apply to load all four cleaned tables into the data model.
Expected Result
Four new tables (appointments, billing, doctors, treatments) appear in the Data pane with correct type icons (calendar for dates, # for decimals).
Mini Lab / Scenario Task
Add a conditional column in the appointments query called Visit Urgency that flags rows where reason_for_visit = “Emergency” as “High” and everything else as “Standard”.