Skip to content
Power BI Guide — Data Modeling, DAX Formulas, Power Query & Dashboards

Power BI Guide — Data Modeling, DAX Formulas, Power Query & Dashboards

DodaTech Updated Jun 15, 2026 5 min read

Microsoft Power BI is a business analytics tool that transforms raw data into interactive visualizations — deeply integrated with the Microsoft ecosystem.

What You’ll Learn

In this tutorial, you’ll learn Power BI’s data modeling with star schema, DAX formulas (measures, calculated columns), Power Query for ETL, and how to build interactive reports and dashboards.

Why It Matters

Power BI is the #1 analytics platform in the Gartner Magic Quadrant, used by 97% of Fortune 500 companies. It’s the standard tool for business intelligence in Microsoft-centric organizations.

Real-World Use

A manufacturing company uses Power BI to track production KPIs in real time. Data flows from SQL Server to Power BI via DirectQuery. DAX measures calculate efficiency, downtime percentage, and OEE (Overall Equipment Effectiveness). Power BI dashboards are shared via Power BI Service.


graph LR
  subgraph "Data Sources"
    A[SQL Server]
    B[Excel]
    C[SharePoint]
  end
  subgraph "Power BI Desktop"
    D[Power Query]
    E[Data Model]
    F[DAX Measures]
    G[Visuals]
  end
  subgraph "Power BI Service"
    H[Dashboards]
    I[Reports]
    J[Apps]
  end
  A --> D
  B --> D
  C --> D
  D --> E
  E --> F
  F --> G
  G --> H
  G --> I
  I --> J

Data Modeling: Star Schema

A star schema has a central fact table surrounded by dimension tables.

Table TypePurposeExample
Fact TableMeasures (numerical, additive)Sales (order_id, product_id, date_id, amount)
DimensionAttributes (descriptive)Products (product_id, name, category, price)

Relationships

  • One-to-many: Dimension → Fact (one product, many sales)
  • Snowflake: Dimensions normalized into additional tables (not recommended in Power BI)
Sales (Fact)
  ├── DateID → Date (Dimension)
  ├── ProductID → Products (Dimension)
  ├── CustomerID → Customers (Dimension)
  └── StoreID → Stores (Dimension)

DAX (Data Analysis Expressions)

DAX is Power BI’s formula language, similar to Excel formulas but designed for tabular data models.

Measures vs Calculated Columns

MeasureCalculated Column
When evaluatedAt query time (dynamic)At data refresh (static)
StorageNot stored (computed in memory)Stored in the model
PerformanceBetter (computed when needed)Worse (uses RAM)
Use caseAggregations, KPIsRow-level categorization

Important DAX Functions

-- Basic aggregation
Total Sales = SUM(Sales[Amount])
Total Quantity = SUM(Sales[Quantity])
Order Count = COUNTROWS(Sales)

-- Time intelligence
Sales LY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
Sales YTD = TOTALYTD([Total Sales], 'Date'[Date])
Sales QoQ = CALCULATE([Total Sales], PREVIOUSQUARTER('Date'[Date]))

-- Filter context
Sales Electronics = CALCULATE([Total Sales], Products[Category] = "Electronics")
Sales Top 10% = CALCULATE([Total Sales], TOPN(10, Products, [Total Sales]))

-- Ratio measures
Profit Margin = DIVIDE([Total Profit], [Total Sales], 0)
Growth % = DIVIDE([Total Sales] - [Sales LY], [Sales LY], 0)

-- Ranking
Product Rank = RANKX(ALL(Products[Name]), [Total Sales])

Row Context vs Filter Context

-- Row context: operates row by row
Calculated Column = Products[Price] * 0.9  -- 10% discount per product

-- Filter context: operates on filtered data
Measure = CALCULATE(SUM(Sales[Amount]), Products[Category] = "Clothing")

Power Query (M Language)

Power Query is Power BI’s ETL engine. It handles data transformation before data enters the model.

// M language snippet (Power Query)
let
    Source = Sql.Database("server", "SalesDB"),
    SalesTable = Source{[Schema="dbo", Item="Sales"]}[Data],
    FilteredRows = Table.SelectRows(SalesTable, each [Date] >= #date(2025, 1, 1)),
    GroupedRows = Table.Group(FilteredRows, {"ProductID"}, {
        {"TotalSales", each List.Sum([Amount]), type number}
    }),
    SortedRows = Table.Sort(GroupedRows, {{"TotalSales", Order.Descending}})
in
    SortedRows

Common Power Query Transformations

  • Remove columns, rename, reorder
  • Filter rows, remove duplicates
  • Split columns, merge columns
  • Pivot/unpivot
  • Merge (SQL JOIN equivalent) and append queries
  • Add custom columns with M formulas

Building a Report

Page Layouts

  1. Overview page: High-level KPIs (total sales, profit, growth)
  2. Drill-down page: Regional/category breakdown
  3. Detail page: Transaction-level data with filters

Visuals

VisualBest For
CardSingle KPI value
Line chartTrends over time
Bar/ColumnCategory comparison
Pie/DonutComposition (limited categories)
MapGeographic distribution
MatrixTabular data with subtotals
ScatterCorrelation between measures
Decomposition treeRoot cause analysis

Common Mistakes

  1. Using calculated columns instead of measures: Measures are evaluated at query time, saving RAM. Use columns only for row-level calculations or relationships.
  2. Ignoring star schema design: Importing flat tables leads to slow performance and complex DAX. Always model as fact + dimensions.
  3. Forgetting to mark date tables: Time intelligence functions (TOTALYTD, SAMEPERIODLASTYEAR) require a properly marked date table.
  4. Overloading visuals: One visual = one insight. Don’t put 10 measures on one bar chart.
  5. Not using explicit measures: Writing SUM(Sales[Amount]) in a visual creates an implicit measure. Define explicit measures for clarity and reuse.

Practice Questions

  1. What is the difference between a measure and a calculated column? Measures evaluate at query time (dynamic) and aren’t stored. Calculated columns evaluate at refresh time and consume RAM.

  2. What is a star schema? A central fact table with measures surrounded by dimension tables with descriptive attributes. Optimized for analytics queries.

  3. What does CALCULATE do in DAX? It modifies the filter context before evaluating an expression — the most important DAX function for dynamic calculations.

  4. What is the M language used for? M is Power Query’s formula language for data transformation (ETL) — filtering, grouping, merging, and cleaning data.

  5. How is Power BI different from Tableau? Power BI has deeper Microsoft ecosystem integration and lower cost. Tableau offers more visualization flexibility and complex analytics.

Challenge

Connect Power BI to a public dataset (e.g., COVID-19 data from Our World in Data). Model it as a star schema. Build a dashboard with time series, geographic map, and trend analysis with DAX time intelligence.

Real-World Task

Connect Power BI to a SQL database or Excel file. Create a data model with at least one fact table and 3 dimensions. Write 5 DAX measures including a time intelligence calculation.

Mini Project: Sales Analysis Dashboard

Build a Power BI dashboard analyzing a sales dataset. Include: monthly sales trend, top products, regional breakdown, profit margin analysis, and a what-if parameter for discount impact simulation.

Security angle: Power BI supports row-level security (RLS) — restrict regional managers to see only their region’s data. Always test RLS before publishing to Power BI Service.

What’s Next

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.

What’s Next

Congratulations on completing this Power BI guide! Here’s where to go from here:

  • Practice daily — Consistency is more important than long study sessions
  • Build a project — Apply what you learned by building something real
  • Explore related topics — Check out other tutorials in the same category
  • Join the community — Discuss with other learners and share your progress

Remember: every expert was once a beginner. Keep coding!

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro