Day 01 Part 1 — Power BI Basics¶
Power BI is Microsoft's business intelligence platform — and the most in-demand BI tool in the job market. This session takes you from zero to building your first interactive report: connecting data, shaping it in Power Query, modelling relationships, and writing your first DAX measures.
Learning Objectives¶
- Understand the Power BI workflow: Get Data → Transform → Model → Visualise → Publish
- Connect to data sources and clean data in Power Query
- Build a data model with relationships
- Write basic DAX measures
- Create your first interactive report
The Power BI Ecosystem¶
| Component | What it does |
|---|---|
| Power BI Desktop | Free Windows app where you build reports (your main tool) |
| Power BI Service | Cloud platform for publishing and sharing (app.powerbi.com) |
| Power BI Mobile | View reports on phone/tablet |
| Power Query | Built-in ETL engine for cleaning data |
| DAX | Formula language for measures and calculated columns |
The Workflow¶
1. GET DATA → connect to Excel, SQL, web, etc.
2. TRANSFORM → clean in Power Query Editor
3. MODEL → define relationships between tables
4. VISUALISE → drag fields onto the report canvas
5. PUBLISH → upload to Power BI Service to share
Step 1 — Get Data¶
Common sources: Excel, CSV, SQL Server, PostgreSQL, SharePoint, Web, Folder.
For analysts
Connect to a folder of CSVs (Get Data → Folder) to automatically combine all monthly files — and re-combine them on every refresh when new files are added.
Step 2 — Power Query (Transform)¶
Power Query records every cleaning step. When you refresh, all steps re-run automatically on the new data — this is the killer feature over manual Excel cleaning.
Common transformations: - Remove blank rows / columns - Change data types - Split columns by delimiter - Pivot / unpivot - Merge queries (join tables) - Group by (aggregate) - Add conditional columns
Set column data types early
The first thing to check in Power Query: are dates recognised as dates, numbers as numbers? Wrong types break everything downstream. Fix them in Power Query, not in the report.
Step 3 — Data Model and Relationships¶
In Model view, drag a field from one table to the matching field in another to create a relationship.
Star schema is the gold standard: - One central fact table (transactions, orders, sales) - Surrounding dimension tables (date, product, customer, region) - Relationships flow from the "one" side (dimension) to the "many" side (fact)
Always create a dedicated Date table
Power BI's time intelligence (YTD, YoY, MoM) requires a proper date table. Create one with DateTable = CALENDAR(...), mark it as a date table, and relate it to your fact table's date column.
Step 4 — Your First DAX Measures¶
DAX (Data Analysis Expressions) is the formula language. Two types of calculations:
Calculated column (computed at refresh, stored, row context):
Measure (computed at query time, respects filters — prefer these):
Total Revenue = SUM(Sales[Amount])
Total Orders = DISTINCTCOUNT(Sales[OrderID])
Avg Order Value = DIVIDE([Total Revenue], [Total Orders], 0)
Measures over calculated columns
Use measures for aggregations (sums, averages, counts). They don't consume model memory and they respond to slicers and filters. Use calculated columns only for row-level categorisation you need to slice by.
Step 5 — Build a Report¶
Drag fields onto the canvas. Power BI picks a visual; change it in the Visualizations pane.
Essential visuals: - Card — a single big number (KPI) - Clustered column / bar — comparison - Line — trend over time - Table / Matrix — detail - Slicer — interactive filter - Map — geographic data
Practice Exercises¶
Warm-up
1. Connect Power BI Desktop to a CSV (use any project dataset). Load it.
2. In Power Query, change a text-date column to Date type and remove any blank rows.
3. Create a measure Total Revenue = SUM(...) and display it in a Card visual.
Main 4. Build a star schema: load a sales fact table and a separate date dimension. Relate them. 5. Create measures for Total Revenue, Order Count, and Average Order Value. 6. Build a report page with: a KPI card row, a revenue-by-month line chart, and a revenue-by-category bar chart. Add a slicer.
Stretch
7. Add a YoY growth measure using SAMEPERIODLASTYEAR.
8. Connect to a folder of multiple CSVs and combine them automatically.
Interview Questions¶
[Beginner] What is the difference between Power BI Desktop and Power BI Service?
[Beginner] What is Power Query used for?
[Mid-level] What is the difference between a calculated column and a measure? When do you use each?
[Mid-level] What is a star schema and why is it preferred in Power BI?
[Senior] Why does Power BI's time intelligence require a dedicated date table, and how do you set one up correctly?