Mohamed A. Adel.

Power BI Deep Dive

Topic 5 of 12 · In Business Intelligence · September 9, 2026

⏱ 2–3 WeeksIntermediate

Get hands-on with Power BI: data modeling, relationships, DAX basics, Power Query, publishing and workspace management for real BI projects.

++++FREE LEARNING PATHBUSINESS INTELLIGENCBUSINESS INTELLIGENCE · PHASE 2 · INTERMEDIATEPOWER BI DEEP DIVEGet hands-on with Power BI: data modeling, relation…· 2 / 3INTERMEDIATE2–3 WEEKSmotif / matrixSEGMENT × MONTH7478 · 78 · MODULE 3.8

Overview

Power BI is Microsoft's business intelligence platform and the most widely used BI tool in the world. It connects to hundreds of data sources, transforms data with Power Query, models data with a tabular engine, visualizes insights with interactive dashboards, and publishes to the cloud for collaboration.

This topic gives you a complete hands-on introduction to Power BI as a BI professional. You will learn how to import and transform data with Power Query, build a proper data model with relationships, write DAX measures and calculated columns, design reports, publish to the Power BI Service, manage workspaces and implement row-level security. By the end, you will have built a complete, publishable BI report from scratch.

Before You Start

  • Install Power BI Desktop (free) and have AdventureWorksDW or your own fact_sales and dimension tables imported and sitting in Model view
  • Reopen the star schema you built for the data warehousing topic as the modelling reference while you set relationships
  • Keep the list of eight mini-project measures (Total Revenue, Total Cost, Profit, Profit Margin, Total Orders, Average Order Value, Distinct Customers, Revenue MoM Growth) written down to work against
  • Be able to use Get Data to connect to a CSV or SQL source without help before the lesson starts
  • Have a blank one-page report ready so the KPI card row at the top is the first thing you build

Learning Objectives

  • Connect to and import data from multiple sources in Power BI
  • Transform data with Power Query (clean, reshape, merge, append)
  • Build a star schema data model with correct relationships
  • Understand relationship cardinality and cross-filter direction
  • Write basic DAX measures and calculated columns
  • Design interactive reports with slicers, filters and drill-through
  • Publish reports to Power BI Service and manage workspaces
  • Implement row-level security (RLS) for data access control

Prerequisites

Continue from SQL for Business Intelligence for query and data modeling context. Basic familiarity with data concepts (dimensions, facts, KPIs) from earlier topics will help significantly.

Getting Started with Power BI

Power BI consists of three parts:

  • Power BI Desktop — the free Windows application for building reports (data model, DAX, visualizations)
  • Power BI Service — the cloud platform for publishing, sharing, scheduling refreshes and collaboration
  • Power BI Mobile — iOS/Android apps for viewing reports on the go

The workflow is: Desktop (build) → Service (publish and share) → Mobile (consume). You will spend most of your learning time in Desktop, then publish to Service.

Power Query: Import and Transform

Power Query (the "Transform Data" button) is Power BI's ETL engine. It lets you connect to sources, clean and reshape data, and load it into the model — all with a GUI and a formula language called M.

Common transformations:

  • Remove columns — delete unnecessary fields to keep the model lean
  • Change data types — ensure dates are dates, numbers are numbers
  • Filter rows — remove irrelevant data before loading
  • Split columns — break "First Last" into first name and last name
  • Merge queries — JOIN equivalent: combine two tables on a key
  • Append queries — UNION equivalent: stack tables with the same structure
  • Pivot / Unpivot — reshape columns ↔ rows
  • Group by — aggregate data at a different grain
Power Query — Orders Transformpowerquery-m
// Power Query M code example: clean and reshape orders
let
  Source = Csv.Document(File.Contents("orders.csv")),
  PromotedHeaders = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
  TypedColumns = Table.TransformColumnTypes(PromotedHeaders, {
    {"order_date", type date},
    {"revenue", type number},
    {"quantity", Int64.Type}
  }),
  FilteredRows = Table.SelectRows(TypedColumns, each [revenue] > 0),
  AddedMonth = Table.AddColumn(FilteredRows, "month", 
    each Date.Month([order_date]), Int64.Type)
in
  AddedMonth

Data Modeling and Relationships

The Model view in Power BI is where you define how tables relate. A well-built model follows the star schema you learned in data warehousing: one fact table in the center, dimension tables around it.

Relationship properties:

PropertyOptionsWhat It Means
CardinalityOne-to-One, One-to-Many, Many-to-One, Many-to-ManyHow rows in one table relate to rows in another
Cross-filter directionSingle, BothWhich direction filters propagate (dim → fact = single; both = bidirectional)
ActiveYes / NoOnly one active relationship between two tables at a time

Best practice: always use single cross-filter direction (dim → fact). Both directions cause ambiguity and performance issues. Create role-playing dimensions (e.g. order date vs ship date) with separate inactive relationships and use USERELATIONSHIP in DAX.

Role-Playing Dimension DAXdax
-- Role-playing dimension: use inactive relationship in DAX
// Inactive relationship: fact_sales[ship_date_key] → dim_date[date_key]

Shipping Revenue = 
  CALCULATE(
    SUM(fact_sales[revenue]),
    USERELATIONSHIP(fact_sales[ship_date_key], dim_date[date_key])
  )

DAX Basics: Measures and Calculated Columns

DAX (Data Analysis Expressions) is the formula language of Power BI. There are two main types of calculations:

Measures — calculated on the fly at query time, using the filter context of the visual they appear in. Measures are the primary way to write KPIs. They are defined in the model and referenced by visuals.

Calculated columns — computed row by row when data is loaded, stored in the table. Use them sparingly — they increase model size and load time. Use measures instead whenever possible.

Key DAX functions to start with:

FunctionPurposeExample
SUMAdd valuesSUM(fact_sales[revenue])
AVERAGEMean of valuesAVERAGE(fact_sales[revenue])
COUNTROWSCount rows in a tableCOUNTROWS(fact_sales)
DISTINCTCOUNTCount unique valuesDISTINCTCOUNT(fact_sales[customer_key])
CALCULATEModify filter contextCALCULATE(SUM(revenue), dim_product[category] = "Electronics")
FILTERReturn a filtered tableFILTER(fact_sales, fact_sales[revenue] > 1000)
Basic DAX Measures.daxdax
// Basic measures
Total Revenue = SUM(fact_sales[revenue])

Total Orders = COUNTROWS(fact_sales)

Average Order Value = 
  DIVIDE([Total Revenue], [Total Orders], 0)

// CALCULATE changes the filter context
Electronics Revenue = 
  CALCULATE(
    [Total Revenue],
    dim_product[category] = "Electronics"
  )

// CALCULATE + FILTER for complex conditions
High Value Revenue = 
  CALCULATE(
    [Total Revenue],
    FILTER(fact_sales, fact_sales[revenue] > 1000)
  )

Designing Reports

The Report view is where you build visuals. Power BI offers many chart types: bar, column, line, pie, map, card, table, matrix, KPI indicator and more.

Report design principles for BI:

  1. One page = one question — each report page should answer a single business question
  2. Most important number top-left — managers read left-to-right, top-to-bottom
  3. Slicers for interactivity — add date, region and category slicers so users can filter
  4. Drill-through — enable users to click a summary value and see the underlying detail
  5. Tooltips — add context on hover without cluttering the main visual
  6. Consistent formatting — same fonts, colors and number formats across all visuals

Publishing and Workspace Management

Publishing sends your Desktop file to the Power BI Service (app.powerbi.com). From there:

  • Workspaces — collaborative containers where team members build and manage content. A "Sales BI" workspace might contain the sales report, dataset and dashboard.
  • Datasets — the published data model. Reports connect to datasets; multiple reports can share one dataset.
  • Dashboards — a single-page canvas (different from a report) that pins visuals from multiple reports for an executive overview.
  • Scheduled refresh — configure the gateway and refresh schedule so data stays current without manual re-publishing.
  • Sharing — share via workspace access, app (organized collection of reports), or direct link.

Row-Level Security (RLS)

RLS restricts data access at the row level so users only see the data they are authorized to see. For example, a regional sales manager sees only their region's data.

In Power BI, RLS is defined in Desktop (Model view → Manage Roles) using DAX filter expressions:

RLS Role Definition.daxdax
// RLS role: Regional Manager sees only their region
[region] = LOOKUPVALUE(
  dim_user[user_region],
  dim_user[user_email],
  USERPRINCIPALNAME()
)

// Or simpler: filter dim_store by current user
[store_manager] = USERPRINCIPALNAME()

Hands-On Practice

You need Power BI Desktop (free download from Microsoft).

  1. Download a public dataset (e.g. AdventureWorksDW or a Kaggle sales dataset). Import it into Power BI Desktop.
  2. In Power Query: clean the data — remove unnecessary columns, fix data types, filter nulls, rename columns to friendly names.
  3. In Model view: create a star schema with one fact table and at least 3 dimension tables. Set cardinality and cross-filter direction correctly.
  4. Create 5 measures: Total Revenue, Total Orders, Average Order Value, Distinct Customers, Revenue % of Total.
  5. Build a one-page report: a KPI card row at the top, a bar chart (revenue by category), a line chart (monthly trend), a table (top 10 products) and a slicer for region.
  6. Add drill-through from the bar chart to a detail page showing individual orders.
  7. Publish to Power BI Service (sign up for a free account). Create a workspace, upload your file, and schedule a refresh.

Deeper Worked Examples

These examples push further than the core content — each one is a complete, step-by-step solution you can follow and then reproduce on your own.

Fixing a broken auto-generated data model

Problem. You import fact_sales with 200,000 rows plus dim_product, dim_store, dim_date and dim_customer into Power BI. Auto-detect creates a web of many-to-many relationships and the Total Revenue measure returns inflated totals. Rebuild the model correctly.
1

Step 1

Open Model view, delete every auto-created relationship, and confirm the key columns exist: fact_sales carries product_key, store_key, date_key and customer_key.
2

Step 2

Create one-to-many relationships from each dimension's surrogate key to the matching foreign key in fact_sales, with the dimension on the 'one' side and the fact on the 'many' side.
3

Step 3

Set every relationship to single cross-filter direction (dimension to fact) and mark one relationship per dimension as active, leaving role-playing links such as ship_date_key inactive.
4

Step 4

Verify the base measure Total Revenue as SUM(fact_sales[revenue]) against a DAX Studio query of the same grain, confirming no duplicated totals remain.
5

Step 5

Add the role-playing pattern for shipping analysis: Shipping Revenue = CALCULATE(SUM(fact_sales[revenue]), USERELATIONSHIP(fact_sales[ship_date_key], dim_date[date_key])) and check it against the order-date revenue for a known month.
6

Step 6

Stress-test with slicers on region and category, confirming totals reduce correctly, and check DISTINCTCOUNT(fact_sales[customer_key]) for Distinct Customers to confirm no fan-out.

Cleaning an inconsistent raw export in Power Query

Problem. A payments CSV arrives with mixed date formats, negative amounts, a combined store column such as 'Cairo / Downtown' and 400 blank payment_id rows. Transform it in Power Query so a clean table loads into the model.
1

Step 1

Start in Power Query and run Table.PromoteHeaders so the first row becomes column names, then change data types on order_date and revenue.
2

Step 2

Split the combined store column on the slash delimiter into store_city and store_name using Split Column by Delimiter, then trim surrounding whitespace.
3

Step 3

Remove the invalid rows with Table.SelectRows filtering payment_id not equal to null, after confirming with the business that blank ids mean the rows are unusable.
4

Step 4

Filter negative amounts with Table.SelectRows keeping each [revenue] greater than 0, mirroring the topic's FilteredRows example.
5

Step 5

Add a month column with Date.Month([order_date]) for the trend visual, keeping this transformation in Power Query rather than duplicating it in DAX.
6

Step 6

Load and document the row count: 200,000 source rows minus 400 blanks minus 1,200 negative rows equals 198,400 loaded rows, recorded in a query notes step.

Common Mistakes

  • Using calculated columns instead of measures — measures are computed at query time and do not bloat the model
  • Setting cross-filter direction to Both on every relationship — use Single unless you have a specific reason
  • Importing all columns from source tables — remove unnecessary columns in Power Query to keep the model lean
  • Building calculations in the visual instead of the model — always define KPIs as DAX measures for reuse
  • Ignoring relationships and using LOOKUPVALUE everywhere — relationships are faster and more maintainable
  • Publishing without testing RLS — test with the View As feature before sharing with users
  • Overloading one page with too many visuals — split into focused pages, one question per page

Real-World Usage

Power BI is the BI tool of choice for most Microsoft-centric organizations and increasingly popular across industries. A financial analyst builds an P&L report in Desktop, publishes it to a Finance workspace, and the CFO accesses it via a Power BI app on their phone. An operations manager has a live dashboard refreshing every 15 minutes from a SQL warehouse. A regional director has RLS applied so they only see their territory. The skills in this topic — modeling, DAX, Power Query, publishing, security — are exactly what gets you hired as a BI analyst or Power BI developer.

Mini Project

Business problem: A retail chain with 50 stores needs an executive dashboard showing revenue, profit, store performance and product category trends. The data comes from a SQL warehouse.

Dataset: use the AdventureWorksDW sample database (free download from Microsoft) or any sales dataset with fact_sales, dim_product, dim_store, dim_date and dim_customer tables.

Objective: build a complete, publishable Power BI report with a data model, measures, interactive visuals and RLS.

1

Task 1

Connect Power BI Desktop to your data source and import the tables.
2

Task 2

In Power Query: clean each table (fix types, remove unused columns, rename for clarity).
3

Task 3

In Model view: build a star schema. Set fact_sales relationships to each dimension with Single cross-filter direction.
4

Task 4

Create 8 DAX measures: Total Revenue, Total Cost, Profit, Profit Margin %, Total Orders, Average Order Value, Distinct Customers, Revenue MoM Growth.
5

Task 5

Build Page 1 (Executive Overview): 4 KPI cards, revenue trend line chart, profit by category bar chart, top 10 stores table, region slicer and date slicer.
6

Task 6

Build Page 2 (Store Detail): drill-through from Page 1 store names. Show store-level metrics and a monthly trend for the selected store.
7

Task 7

Implement RLS: create a Store Manager role that filters dim_store by USERPRINCIPALNAME(). Test with View As.
8

Task 8

Publish to Power BI Service. Create a workspace, configure a scheduled refresh (if using a gateway) or use Import mode. Share with a test user.
DeliverableWhat It Proves
Clean Power Query transformationsYou can prepare data in Power BI
Star schema with correct relationshipsYou understand data modeling
8 DAX measuresYou can write BI-grade calculations
2-page interactive reportYou can design effective visualizations
RLS implemented and testedYou understand security and access control
Published and shared via ServiceYou can deliver BI to end users

Key Takeaways

  • Power BI = Desktop (build) → Service (publish/share) → Mobile (consume)
  • Power Query: clean, transform, merge data before loading into the model
  • Star schema model: one fact table, dimensions around it, Single cross-filter direction
  • Measures (query-time) are preferred over calculated columns (row-time) for performance
  • CALCULATE is the most important DAX function — it modifies the filter context
  • Report design: one question per page, KPI cards top-left, slicers for interactivity, drill-through for detail
  • Publish to Service, organize in workspaces, schedule refreshes, share via apps
  • RLS restricts row-level data access using DAX filter expressions

Key Terms & Glossary

The vocabulary this topic uses, defined the way a working professional would.
TermMeaning
MeasureA DAX calculation evaluated at query time under the current filter context of the visual, stored only as a definition and never duplicating data in the model.
Calculated columnA DAX column computed row by row when data loads and physically stored, which increases model size and should therefore be used sparingly.
Cross-filter directionWhether filters propagate one way (dimension to fact, recommended) or both ways between two related tables; Both creates ambiguity and slower queries.
CardinalityThe type of relationship between two tables: one-to-many, one-to-one or many-to-many, describing how rows relate to one another.
Row-level securityDAX-based rules that restrict which rows a given user can see, for example a regional manager seeing only their region's data.
Power QueryPower BI's ETL engine using the M language, where import, cleaning, merging and reshaping happen before the data reaches the model.

Learning Resources

These curated sources go deeper than this module: official docs, books, interactive practice, and full courses. Mix them into your routine to go from comfortable to professional.

Microsoft Learn — Power BI Guided Learning

The official, structured learning path from Microsoft covering all Power BI fundamentals.

Open resource ↗

Pragmatic Works — Power BI Training

Free and paid Power BI training videos from industry experts.

Open resource ↗

DAX Guide — dax.guide

The definitive reference for every DAX function with syntax and examples.

Open resource ↗

Guy in a Cube — Power BI (YouTube)

The most popular Power BI YouTube channel — tips, tricks and best practices.

Open resource ↗

Power BI Community

Microsoft's official community forum — search or ask questions about any Power BI topic.

Open resource ↗

SQLBI — DAX Best Practices

Expert articles on DAX optimization, data modeling and Power BI performance from Marco Russo and Alberto Ferrari.

Open resource ↗

Chapter Quiz

Put this lesson to work: answer the questions below, get instant feedback and a pass/fail score. Score 70% or higher before you move on — that is your gate to the next topic.

Chapter Quiz — Power BI Deep Dive

Desktop to Service, Power Query versus DAX, star-schema modeling, single-direction relationships and RLS.

0 / 5

Question 1 of 5

Which is evaluated at query time under the visual's filter context and adds nothing to model size?

Knowledge Check

A measure is calculated at query time based on the filter context of the visual it appears in — it does not store data in the model. A calculated column is computed row by row when data is loaded and stored in the table, increasing model size. Always prefer measures for performance.
Both directions allow filters to propagate in both directions, which can create ambiguous filter paths and unexpected results. Single direction (dimension → fact) is predictable, performs better, and follows star schema best practice.
In Power Query. Power Query handles ETL-type operations (type casting, renaming, filtering nulls, removing columns). DAX is for model-level calculations (measures, time intelligence). Mixing cleaning into DAX makes models harder to maintain and slower.
DIVIDE(numerator, denominator, alternateResult) safely handles division by zero by returning the alternateResult (or BLANK) instead of an error. Always use DIVIDE for KPI calculations like revenue per order or conversion rate.
In Power BI Desktop, go to Model view → Manage Roles → View As. Select a role and enter a test user principal name. The report will filter data as that user would see it. Verify that only the expected rows are visible.

End-of-Topic Exam

Hint: The mistakes section and the measure-versus-column knowledge check cover this.

Model answer: The 2025 question is best served by a measure, not a calculated column. A calculated column is computed at load, stored physically in the model, inflates the file and slows refresh. The measure Revenue 2025 = CALCULATE([Total Revenue], dim_date[year] = 2025) is evaluated at query time, adds nothing to model size and is reusable in every visual. The wrong choice quietly degrades performance as the table grows, and couples a date rule into stored data that belongs in the model.

Hint: Use the RLS role example and its callout from the topic.

Model answer: Create an RLS role in Model view with a filter such as dim_store[region] equal to LOOKUPVALUE(dim_user[user_region], dim_user[user_email], USERPRINCIPALNAME()) so each manager sees only rows matching their email, then test with View As before publishing. After publishing, assign members to the appropriate workspace or app so only authorised people can reach the report. RLS is the row-level, last-line defence and is not a substitute for workspace permissions, app access, sensitivity labels or wider governance, all of which should be combined with it.

Hint: The 'Keep transformations in Power Query, not DAX' callout plus the mistakes list.

Model answer: Power Query is the ETL stage: type casting, renaming columns, filtering nulls, splitting columns, merging and appending queries belong there, and they then run as reproducible pipeline steps before the model loads. DAX is for context-aware calculation: measures, time intelligence, CALCULATE and ranking belong in the model. Embedding cleaning in DAX, such as casting types inside a measure or filtering raw text per visual, duplicates logic, slows queries and makes models hard to maintain. Marks are gained for two clear examples on each side.

Next Step

Congratulations — you just finished Power BI Deep Dive. The next topic is DAX & Advanced Calculations. Press on when you are ready: it will build directly on what you practiced here.