MinAI - Về trang chủ
Hướng dẫn
3/1345 phút
Đang tải...

Power BI Fundamentals

Làm chủ Power BI Desktop - Data modeling, DAX basics, và tạo interactive reports

0

🎯 Mục tiêu bài học

TB5 min

Sau bài học này, bạn sẽ:

✅ Hiểu Power BI ecosystem: Desktop, Service, Mobile

✅ Connect và transform data với Power Query

✅ Build star schema data model với relationships

✅ Viết DAX formulas: SUM, CALCULATE, Time Intelligence

✅ Tạo interactive reports với slicers và drill-through

✅ So sánh Power BI vs Tableau — khi nào dùng cái nào

Thời gian: 45 phút | Độ khó: Beginner | Tool: Power BI Desktop (Free)

1

📖 Bảng Thuật Ngữ Quan Trọng

TB5 min
Thuật ngữTiếng ViệtMô tả
DAXData Analysis ExpressionsFormula language của Power BI
MeasurePhép đoAggregation calculated at runtime
Calculated ColumnCột tính toánRow-by-row calculation, stored in model
Star SchemaMô hình saoFact table ở giữa, dimensions xung quanh
Power QueryTruy vấn nguồnETL tool tích hợp trong Power BI
SlicerBộ lọc trực quanInteractive filter control trên report
Drill-throughKhoan sâuClick → navigate to detail page
BookmarkĐánh dấuLưu state cụ thể (filters, visible visuals)
Filter ContextNgữ cảnh bộ lọcTập hợp filters đang active cho calculation
CALCULATEHàm CALCULATEDAX function thay đổi filter context

Checkpoint

DAX = formula language của Power BI. Measure = aggregation at runtime. CALCULATE = thay đổi filter context. Star Schema = fact + dimensions. Bạn phân biệt Measure vs Calculated Column chưa?

2

🖥️ 1. Power BI Ecosystem

TB5 min

1.1 Power BI Products

ProductPlatformPurposeCost
Power BI DesktopWindowsCreate reportsFree
Power BI ServiceWebShare & collaborateFree/$10/mo
Power BI MobileiOS/AndroidView on mobileFree
Power BI Report ServerOn-premiseInternal hostingLicense

1.2 Power BI Desktop Interface

Power BI Desktop Layout
Khu vựcVị tríNội dung
RibbonTopFile, Home, Insert, Modeling, View, Optimize, Help
Filters PaneLeftPage/Visual/Drillthrough filters
Report CanvasCenterDrag visuals here
VisualizationsRight-topChart type selector (▤▥▦▧▨▩)
FieldsRight-bottomTables and columns hierarchy
View TabsBottom📊 Report · 📋 Data · 🔗 Model

1.3 Three Views

ViewIconPurpose
Report📊Build visualizations
Data📋View/edit tables
Model🔗Manage relationships

Power BI Desktop hoàn toàn miễn phí! Chỉ cần trả phí khi publish lên Service cho team collaboration. Download tại powerbi.microsoft.com

Checkpoint

Power BI có 3 views: Report (build visuals), Data (xem tables), Model (manage relationships). Desktop = Free, chỉ Service cần trả phí!

3

📥 2. Getting Data & Power Query

TB5 min

2.1 Data Sources

📥Get Data → Categories
📄File (Excel, CSV, JSON, PDF)
🗄️Database (SQL Server, MySQL, PostgreSQL)
Power Platform (Dataverse, Dataflows)
☁️Azure (Synapse, Blob Storage)
🌐Online Services (SharePoint, Dynamics 365)
🔧Other (Web, ODBC, Python/R scripts)

2.2 Load vs Transform

OptionWhen to Use
LoadData is clean, ready to use
TransformNeed cleaning, reshaping

2.3 Power Query Editor

Power Query Editor Layout
Khu vựcVị tríNội dung
RibbonTopHome, Transform, Add Column, View, Tools, Help
QueriesLeft-topOrders, Products, Customers
Applied StepsLeft-bottomSource → Navigation → Changed Type
PreviewCenterData table preview (OrderID, Date, Customer, Amount)
Formula BarCenter-top= Table.TransformColumnTypes(...)

2.4 Common Transformations

ActionUse Case
Remove columnsDelete unnecessary fields
Filter rowsRemove nulls, errors
Change typeText → Number, Date
Replace valuesClean up data
Split column"John Doe" → "John", "Doe"
Merge queriesJoin tables
Append queriesStack tables
Pivot/UnpivotReshape data structure

Power Query = ETL trong Power BI. Mọi bước transform được ghi lại thành Applied Steps — có thể undo, reorder, hoặc edit bất cứ lúc nào!

Checkpoint

Power Query ghi lại mọi transform thành Applied Steps. Common transforms: remove columns, filter rows, change types, pivot/unpivot. Bạn đã dùng Transform Data chưa?

4

🔗 3. Data Modeling

TB5 min

3.1 Star Schema

FACT_Sales (SalesKey, DateKey, ProductKey, CustomerKey, Amount, Quantity)
📅DIM_Date
📋DateKey, Date, Month, Year
📦DIM_Product
📋ProductKey, ProductName, Category
👥DIM_Customer
📋CustomerKey, CustomerName, Segment

3.2 Creating Relationships

Model View → Drag field from Table A to Table B

🔗Relationship Properties
🔢Cardinality: One-to-Many, Many-to-Many
🔀Cross Filter: Single, Both
Active: Yes/No
Referential Integrity: Assume (for performance)

3.3 Best Practices

DO:

  • Use star schema (facts + dimensions)
  • Hide technical keys from report view
  • Create date dimension table
  • Name tables and columns clearly

DON'T:

  • Many-to-many without bridge table
  • Circular dependencies
  • Too many bi-directional filters
  • Wide tables với 100+ columns

Star Schema là foundation của mọi Power BI model tốt. Fact table chứa numbers (Sales, Quantity), Dimension tables chứa attributes (Product Name, Region). Không có star schema → DAX sẽ rất khó viết!

Checkpoint

Star Schema: Fact table (numbers) ở giữa, Dimension tables (attributes) xung quanh. Relationships thường One-to-Many, single direction. Bạn đã tạo model view chưa?

5

📐 4. DAX Basics

TB5 min

4.1 Calculated Column vs Measure

AspectCalculated ColumnMeasure
CalculatedRow by rowOn aggregation
StorageStored in modelCalculated at runtime
UseCategorization, filteringAggregations, KPIs
PerformanceUses memoryMore efficient

4.2 Essential DAX Functions

dax
1-- SUM, AVERAGE, COUNT
2Total Sales = SUM(Sales[Amount])
3Avg Order = AVERAGE(Sales[Amount])
4Order Count = COUNT(Sales[OrderID])
5
6-- DISTINCTCOUNT
7Customer Count = DISTINCTCOUNT(Sales[CustomerID])
8
9-- CALCULATE - thay đổi filter context
10Sales East = CALCULATE(
11 SUM(Sales[Amount]),
12 Region[RegionName] = "East"
13)
14
15-- Time Intelligence
16Sales YTD = TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])
17Sales PY = CALCULATE(
18 SUM(Sales[Amount]),
19 SAMEPERIODLASTYEAR('Date'[Date])
20)
21
22-- Year-over-Year Growth
23YoY Growth =
24VAR CurrentYear = SUM(Sales[Amount])
25VAR LastYear = CALCULATE(
26 SUM(Sales[Amount]),
27 SAMEPERIODLASTYEAR('Date'[Date])
28)
29RETURN
30DIVIDE(CurrentYear - LastYear, LastYear, 0)

4.3 Filter Context & ALL

dax
1-- ALL removes filter context
2Total All Products = CALCULATE(
3 SUM(Sales[Amount]),
4 ALL(Product)
5)
6
7-- % of Total
8% of Total =
9DIVIDE(
10 SUM(Sales[Amount]),
11 CALCULATE(SUM(Sales[Amount]), ALL(Sales)),
12 0
13)

4.4 Variables (VAR)

dax
1Profit Margin =
2VAR TotalRevenue = SUM(Sales[Revenue])
3VAR TotalCost = SUM(Sales[Cost])
4VAR Profit = TotalRevenue - TotalCost
5RETURN
6DIVIDE(Profit, TotalRevenue, 0)

CALCULATE là hàm quan trọng nhất trong DAX — nó thay đổi filter context. VAR giúp code clean và readable. Luôn dùng DIVIDE thay vì / để tránh divide-by-zero errors!

Checkpoint

CALCULATE = thay đổi filter context. ALL = remove filters. DIVIDE = safe division. VAR = clean code. Measure > Calculated Column cho performance!

6

📊 5. Building Reports

TB5 min

5.1 Visual Types

Visualizations Pane
IconVisual Type
Stacked bar
Clustered bar
Stacked column
Line chart
Area chart
Combo chart
Pie/Donut
Treemap
🗺Map
📊Matrix
📋Table
📇Card
🎯KPI
Slicer

5.2 Card Visuals for KPIs

KPI Cards
KPIValueChange
Total Sales$2.5M▲ 15%
Profit$420K▲ 8%
Orders12,547▲ 22%

5.3 Slicers & Filters

Slicer types:

  • List (checkboxes)
  • Dropdown
  • Date range (slider)
  • Relative date ("Last 30 days")

Checkpoint

Power BI có 15+ visual types. Card cho KPIs, Slicer cho interactive filters. Drag fields vào Axis, Values, Legend, Tooltips wells. Bạn đã tạo report đầu tiên chưa?

7

🔄 6. Interactivity & Advanced

TB5 min

6.1 Cross-filtering

Ví dụ
1Click bar in Chart A →
2 Chart B filters to show related data
3 Chart C highlights related data

6.2 Edit Interactions

Format → Edit Interactions

🖱️For each visual, choose
🔍Filter (subset data)
Highlight (dim non-related)
⏹️None (no interaction)

6.3 Drill-through

Ví dụ
1Setup:
21. Create detail page
32. Add drill-through field (e.g., Product)
43. Right-click on visual → Drill through
5
6Main Report: Click "Electronics" →
7 Drill through → Detail page filtered to Electronics

6.4 Bookmarks

Save specific states: Filters applied, Visuals visible/hidden, Page navigation

Use for: Toggle views (detailed/summary), Guided navigation, Presentations

Checkpoint

Cross-filtering = click 1 chart → filter others. Edit Interactions = control filter/highlight/none. Drill-through = navigate to detail page. Bookmarks = saved states!

8

⚖️ 7. Power BI vs Tableau

TB5 min

Comparison

AspectPower BITableau
Price$10/user/mo$70/user/mo
EaseEasier startSteeper curve
VisualizationGoodExcellent
Data ModelingExcellentGood
DAX/CalcsVery powerfulPowerful
MicrosoftNative integrationConnectors
CommunityGrowingMature

When to Use Which?

Choose Power BI:

  • Microsoft 365 organization
  • Budget-conscious
  • Need strong data modeling
  • Self-service BI focus

Choose Tableau:

  • Visualization-heavy needs
  • Complex analytics
  • Cross-platform teams
  • Premium features needed

Cả hai đều tuyệt vời — Power BI mạnh về data modeling + Microsoft integration, Tableau mạnh về visualization + flexibility. Biết cả hai = competitive advantage lớn!

Checkpoint

Power BI: rẻ hơn, Microsoft integration, strong modeling. Tableau: visualization premium, cross-platform. Biết cả hai là competitive advantage trong job market!

9

🏋️ 8. Hands-on: Sales Report

TB5 min
Project

Build executive sales dashboard hoàn chỉnh trong Power BI!

Page 1: Executive Summary

Executive Summary Layout
Vị tríNội dung
KPI Row💰 Revenue: $2.5M · 📈 Growth: +15% · 📦 Orders: 12K · 👥 Customers: 3.2K
Middle LeftRevenue by Month (Line)
Middle RightRevenue by Region (Map)
Bottom LeftTop Products (Bar)
Bottom RightSegment Split (Donut)
FiltersDate Slicer · Region · Segment

Page 2: Product Detail (Drill-through)

Key DAX Measures

dax
1Revenue = SUM(Sales[Amount])
2Revenue YTD = TOTALYTD([Revenue], 'Date'[Date])
3Revenue PY = CALCULATE([Revenue], SAMEPERIODLASTYEAR('Date'[Date]))
4Growth % = DIVIDE([Revenue] - [Revenue PY], [Revenue PY], 0)
5Profit Margin = DIVIDE(SUM(Sales[Profit]), SUM(Sales[Revenue]), 0)
10

📋 Tổng kết

TB5 min

Kiến thức đã học

Chủ đềNội dung chínhTầm quan trọng
EcosystemDesktop (free), Service, MobileOverview
Power QueryETL, Applied Steps, transformsData prep
Data ModelStar schema, relationshipsFoundation
DAXCALCULATE, Time Intelligence, VARCore skill
ReportsCards, Slicers, 15+ visual typesBuilding
InteractivityCross-filter, Drill-through, BookmarksAdvanced
vs TableauPrice, features, when to useCareer

Câu hỏi tự kiểm tra

  1. Power Query vs DAX: khi nào dùng cái nào?
  2. Star schema là gì và tại sao quan trọng?
  3. CALCULATE trong DAX dùng để làm gì?
  4. Cross-filter và cross-highlight khác nhau thế nào?

Bài tiếp theo: Design Best Practices — Nguyên tắc thiết kế dashboard đẹp và hiệu quả!

🎉 Tuyệt vời! Bạn đã nắm vững Power BI Desktop!

Nhớ: Power Query để clean data, DAX để tính toán, Report để trình bày — 3 bước cho mọi dự án BI!