Session 28 · Phase 4: Statistics & Visualization

Power BI / Tableau — Data Import, Modeling & DAX

Build a self-service BI solution: import and clean data, model relationships, and write DAX measures that power interactive dashboards.

⏱ ~2 hrs 📚 Core content 🎯 High priority

Learning Objectives

1. What Power BI Is

Power BI is a business-intelligence tool that turns data into interactive reports and dashboards. The workflow is always the same: Get data → Transform → Model → Visualize → Share.

  1. Get data — connect to sources (Excel, SQL, CSV, web).
  2. Transform — clean and shape with Power Query.
  3. Model — define relationships between tables.
  4. Visualize — build charts and dashboards.
  5. Share — publish to a report server or cloud.

2. Data Import & Cleaning — Power Query

Power Query is the "get and transform" engine. It's where you clean data before it enters the model — the same cleaning concepts from Excel/SQL, but recorded as reusable steps.

📝
Note: every step you apply in Power Query is recorded, so it re-runs automatically when the data refreshes — this "repeatable cleaning" is a key selling point in interviews.

3. Data Modeling — the Star Schema

A star schema organizes data into a central fact table (the numbers/events) surrounded by dimension tables (the descriptive categories), connected by relationships.

Table typeContainsExample
Factmeasures, keys, transactionsSales (amount, date, product key)
Dimensiondescriptive attributesProduct, Customer, Region, Date

Relationships link the fact table to each dimension — this is what lets one dashboard filter across everything.

4. What Is DAX?

DAX (Data Analysis Expressions) is Power BI's formula language — used to create measures and calculated columns. It's like Excel formulas, but designed to work across the whole data model.

Total Sales = SUM(Sales[Amount])

5. Measures vs Calculated Columns — the #1 DAX Question

MeasureCalculated Column
Storednot stored — computed on the flystored, one value per row
When evaluatedat query/visual time (dynamic)at data refresh (static)
Best foraggregations (SUM, AVG, ratios)row-level flags/categories
ExampleTotal Sales = SUM(Sales[Amount])Profit = Sales[Amount] - Sales[Cost]
💡
Rule of thumb: use a measure for anything you aggregate; use a calculated column for a row-by-row value you need to filter or categorize on. Measures are more memory-efficient.

6. CALCULATE() and Context

CALCULATE() is the most important DAX function — it changes the filter context in which an expression is evaluated.

North Sales = CALCULATE(SUM(Sales[Amount]), Region[Name] = "North")

Row context vs filter context

CALCULATE is powerful precisely because it can override or add to the filter context.

7. Power BI vs Tableau

Power BITableau
Formula languageDAXcalculated fields (own syntax)
Best known fortight Excel/ecosystem integration, costrich, flexible visualizations
Learning curvemoderateeasy to start

The concepts transfer — both do import → model → visualize. Know one well and you can pick up the other.

📋 Stable content — Reviewed: August 2026

8. Interview Questions (with Model Answers)

The Power BI/DAX questions interviewers ask. Self-test before revealing.

IQ1. What is Power BI, and what's the typical workflow?

Model answer: "Power BI is a BI tool for building interactive reports and dashboards. The workflow is get data, transform with Power Query, model relationships, visualize, and share."

IQ2. What is Power Query, and what's it used for?

Model answer: "Power Query is the data-cleaning engine. I use it to remove duplicates, split columns, replace values, and change types — and every step is recorded so it re-runs on refresh."

IQ3. What is DAX?

Model answer: "DAX (Data Analysis Expressions) is Power BI's formula language. I use it to write measures and calculated columns that compute across the data model."

IQ4. What's the difference between a calculated column and a measure?

Model answer: "A calculated column is stored row by row at refresh time; a measure is computed dynamically at query time and isn't stored. I use measures for aggregations and columns for row-level values."

IQ5. What does CALCULATE() do?

Model answer: "CALCULATE evaluates an expression under a modified filter context. For example, CALCULATE(SUM(Sales[Amount]), Region[Name] = 'North') sums only North sales regardless of other filters."

IQ6. What's the difference between row context and filter context?

Model answer: "Row context refers to a single row (used in calculated columns); filter context is the set of active filters from slicers and visuals (used in measures). CALCULATE modifies the filter context."

IQ7. What is a star schema?

Model answer: "A star schema is a central fact table (transactions/measures) surrounded by dimension tables (categories like product, customer, date), linked by relationships. It's the standard, efficient layout."

IQ8. What's the difference between Power BI and Tableau?

Model answer: "Both do import → model → visualize. Power BI uses DAX and integrates tightly with Excel; Tableau is known for richer, more flexible visualizations and is easier to start with. The core concepts transfer."

IQ9. Which is more memory-efficient — a measure or a calculated column?

Model answer: "A measure, because it isn't stored — it's computed on the fly. A calculated column is stored for every row, so it uses more memory. That's one reason to prefer measures for aggregations."

Hands-On Project: Build a Mini Model

Describe (or build, if you have Power BI installed) a small sales model.

Steps

  1. Import two tables: Sales (fact) and Region (dimension).
  2. In Power Query, remove duplicates and set correct data types.
  3. Create a relationship between Sales and Region on the region key.
  4. Write a measure Total Sales = SUM(Sales[Amount]).
  5. Write a measure North Sales = CALCULATE(SUM(Sales[Amount]), Region[Name] = "North").
  6. Build a bar chart of Total Sales by region.
View Solution / Walkthrough
  1. Get Data → import Sales and Region.
  2. Transform Data → Remove Duplicates → change Amount to decimal, Date to date.
  3. Model view → drag the region key from Sales to Region to create the relationship.
  4. New Measure → Total Sales = SUM(Sales[Amount]).
  5. New Measure → North Sales = CALCULATE(SUM(Sales[Amount]), Region[Name] = "North").
  6. Bar chart → Axis = Region[Name], Values = Total Sales.

Key Takeaways

1

Power BI workflow: get data → transform → model → visualize → share.

2

Power Query records your cleaning steps so they re-run on refresh.

3

Star schema = central fact table + surrounding dimension tables.

4

Measure = dynamic, not stored; calculated column = stored per row.

5

CALCULATE() modifies the filter context — the heart of DAX.

Objective Questions — Test Your Understanding

Q1. Which Power BI component is used to clean/transform data before loading?

Q2. What does DAX stand for?

Q3. What's the key difference between a measure and a calculated column?

Q4. Which DAX function modifies the filter context?

Q5. In a star schema, the central table that holds transactions/measures is called the…