Last 30 Days
No notifications
Power BI is Microsoft's business intelligence platform used by 97% of Fortune 500 companies. It connects to hundreds of data sources and transforms raw data into interactive reports that drive business decisions.
| Component | Purpose | Use Case |
| Desktop | Build reports & data models | Analyst's primary workspace |
| Service | Publish, share, collaborate | Team dashboards & scheduled refresh |
| Power Query | ETL (Extract, Transform, Load) | Clean & shape data before modeling |
| DAX | Formulas for calculated columns & measures | KPIs, YoY growth, running totals |
| Dataflows | Reusable data prep in the cloud | Shared datasets across reports |
// Remove nulls and filter rows
= Table.SelectRows(Source, each [Sales] <> null and [Sales] > 0)// Add custom column
= Table.AddColumn(Source, "Profit Margin", each [Profit] / [Revenue])
// Merge two tables (LEFT JOIN)
= Table.NestedJoin(Orders, "CustomerID", Customers, "ID", "Cust", JoinKind.LeftOuter)
| Function | Purpose | Example |
CALCULATE | Change filter context | CALCULATE(SUM(Sales), Region="North") |
SUMX | Row-by-row sum | SUMX(Orders, [Qty] * [Price]) |
FILTER | Return filtered table | FILTER(ALL(Products), [Category]="Tech") |
ALL | Remove all filters | CALCULATE(SUM(Sales), ALL(Date)) |
RELATED | Follow relationship | RELATED(Customers[Segment]) |
DIVIDE | Safe division (no /0 error) | DIVIDE([Profit], [Revenue], 0) |
Build relationships between fact tables (transactions) and dimension tables (products, customers, dates). Use one-to-many relationships with filters flowing from dimension → fact. This is the foundation of fast, accurate DAX calculations.
Power BI is Microsoft's end-to-end BI tool: load data with Power Query, model it in the data view, write DAX measures, and publish interactive reports to the Power BI Service. If your company runs on Microsoft 365, this is probably the dashboard you'll be asked to build.
Three apps that work together:
| Component | Job |
| Power BI Desktop | build reports & models on your laptop |
| Power BI Service (web) | share, schedule refresh, manage permissions |
| Power BI Mobile | view on phone/tablet |
A .pbix file is everything — queries, model, measures, visuals — in one bundle.
1. Power Query (Get Data → Transform Data) — connect, clean, shape. Language: M. 2. Model view — define table relationships, mark date table. 3. Data view — write calculated columns / measures in DAX. 4. Report view — drag visuals onto the canvas.
Most beginner pain comes from doing the wrong job in the wrong layer (e.g. cleaning data with DAX instead of Power Query).
1. Cleaning in DAX instead of Power Query. Trim, split, type-cast belong in Power Query — it runs once at refresh.
2. No date table. Time intelligence (SAMEPERIODLASTYEAR, DATESYTD) needs a continuous date table marked as such.
3. Bidirectional or many-to-many relationships everywhere. Performance + ambiguity disaster. Default to one-to-many, single direction.
4. Calculated columns when a measure would do. Columns inflate the file. Measures are computed on demand.
5. One giant table (flat-table thinking). Build a star schema instead: one fact, many dimensions.
6. Auto-date hierarchies on every column. Bloats the model. Turn it off and use your own date table.
Click-driven, but every click writes M code in the formula bar:
let
Source = Csv.Document(File.Contents("sales.csv")),
Promoted = Table.PromoteHeaders(Source),
Typed = Table.TransformColumnTypes(Promoted, {{"Date", type date}, {"Amount", Currency.Type}}),
Cleaned = Table.SelectRows(Typed, each [Amount] <> null and [Amount] > 0)
in
CleanedKey idea: Power Query is applied steps — every transformation is recorded and replayed at every refresh. Reproducible, editable, version-friendly.
DAX is the formula language. The hardest concept is two evaluation contexts:
SUMX, FILTER, AVERAGEX).Total Sales = SUM(Sales[Amount]) -- aggregates within filter context
Revenue Per Unit = SUMX(Sales, Sales[Qty] * Sales[Price]) -- iterates row contextA visual cell value = measure evaluated under that cell's filter context.
CALCULATE *modifies* filter context. It's the verb that powers 80% of business measures:
Sales LY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
Sales Online = CALCULATE([Total Sales], Sales[Channel] = "Online")
Pct of Total = DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Sales)))
YoY % = DIVIDE([Total Sales] - [Sales LY], [Sales LY])ALL removes filters; KEEPFILTERS adds without overriding; REMOVEFILTERS is the modern alias for ALL.
Given a proper date table, DAX makes calendar math one-liners:
Sales YTD = TOTALYTD([Total Sales], 'Date'[Date])
Sales MTD = TOTALMTD([Total Sales], 'Date'[Date])
Sales 12M = CALCULATE([Total Sales], DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH))Always mark your date table: Modeling → Mark as Date Table → Date column.
Profit Margin =
VAR Revenue = SUM(Sales[Amount])
VAR Cost = SUM(Sales[Cost])
VAR Profit = Revenue - Cost
RETURN DIVIDE(Profit, Revenue)VAR for clarity and to evaluate sub-expressions once.DIVIDE(num, den) instead of / — it returns BLANK on divide-by-zero.# Sales, % Margin) so they sort apart from columns.Power BI's column store (VertiPaq) compresses columns aggressively. Tips:
-- Role: Region Manager
[Region] = USERPRINCIPALNAME() -- maps logged-in email to a Region rowDefine roles in Modeling → Manage Roles, assign users in the Service. Each user sees only their slice — same dashboard, different data.
.pbix → Workspace → App.1. Load a sales CSV with Power Query — type the columns, drop nulls, build a date table with Calendar.Auto or DAX CALENDAR.
2. Build a star schema: Sales fact + Date / Product / Customer dimensions.
3. Write 5 measures: Total Sales, Sales LY, YoY %, % of Total, Profit Margin (with VAR + DIVIDE).
4. Build a 1-page report: KPI cards on top, line chart of Sales vs LY, bar by category, slicer by region. Publish to the Service and share.