Power BI

Power BI explained simply, for data analyst and business analyst interviews. Short sentences, small examples, one idea at a time. Most examples use one small made-up Sales table.

Part 1 — Getting Started

1. What Power BI Is

In plain words

Power BI is a Microsoft tool for business intelligence (BI). BI means turning raw data into charts and numbers that help people make decisions.

You connect to data, clean it, link tables together, write a few formulas, and build an interactive report. Then you share it with your team online.

Think of a kitchen. Raw data is the vegetables. Power Query washes and cuts them. The data model is the recipe. The report is the finished plate you serve to guests.

Key points

  • Made by Microsoft. It works very well with Excel, SQL Server, Azure, Teams and SharePoint.
  • Reports are interactive. Click a bar in one chart and the other charts filter too.
  • Three languages you meet: M (Power Query, for cleaning), DAX (for formulas), and a little SQL (to read from databases).
  • A Power BI Desktop file is saved as .pbix. A template (no data, only design) is .pbit. A project folder for Git is .pbip.
  • It is popular because it is cheap, easy to start, and has a free desktop app.

Our example Sales table

Most examples in these notes use this tiny table. Each row is one sale.

DateProductRegionQtyPrice
2025-01-05PenNorth1020
2025-01-07NotebookSouth460
2025-02-11PenSouth620
2025-02-15BagNorth1900
2025-03-02NotebookEast860

Sales amount for one row = Qty × Price. For the first row that is 10 × 20 = 200.

Remember: Power BI = connect + clean + model + visualise + share. If you can explain those five words with an example, you can answer "What is Power BI?".

2. Components & Microsoft Fabric

In plain words

Power BI is not one app. It is a family of tools. You build in one place and share in another.

It is like a bakery. Desktop is the kitchen where you bake. The Service is the shop where customers buy. Mobile is home delivery.

The parts

PartWhat it isWho uses it
Power BI DesktopFree Windows app. You connect, clean, model and design reports here.Report builders (analysts)
Power BI ServiceThe website app.powerbi.com. You publish, share, refresh and build dashboards here.Everyone: builders and viewers
Power BI MobileApps for iOS and Android to view reports on a phone.Managers on the move
Power BI Report ServerAn on-premises server (inside the company, not cloud) to host reports. Needs a special Desktop version.Companies that can't use the cloud
Power BI EmbeddedPut Power BI reports inside your own website or app.Developers

Key points

  • Desktop is Windows only. Mac users run it in a virtual machine, or edit some things in the Service.
  • You can also build simple reports straight in the browser (Service), but Desktop has all the features.
  • Microsoft Fabric (since 2023) is Microsoft's all-in-one data platform. Power BI is now one part ("workload") of Fabric.
  • Fabric adds data engineering, data warehouses and notebooks. All data sits in one shared lake called OneLake.
  • Copilot (AI help) can write DAX, summarise pages and suggest visuals, on paid Fabric capacity.
Remember: build in Desktop, share in the Service, view on Mobile. Report Server is for on-premises only. Fabric is the bigger platform Power BI now lives in.

3. The Power BI Workflow

In plain words

Almost every Power BI project follows the same six steps, in the same order.

It is like making tea. Get the leaves (get data), wash the cup (transform), mix in the right order (model), pour it nicely (visualise), carry it out (publish), and serve it (share).

1. Get data connectors 2. Transform Power Query 3. Model tables + DAX 4. Visualise charts, pages 5. Publish to Service 6. Share apps, links Power BI Desktop (build) Power BI Service (share) After publishing, scheduled refresh keeps the data up to date without opening Desktop.
The six-step workflow. Steps 1–4 happen in Desktop. Steps 5–6 happen in the Service.

How to do it (step by step)

  1. Get data: Home → Get data → pick a source (Excel, SQL Server, CSV, web…).
  2. Transform: click Transform data. Power Query Editor opens. Clean the data, then Close & Apply.
  3. Model: go to Model view. Link tables with relationships. Write measures in DAX.
  4. Visualise: go to Report view. Drag fields onto the page to build charts.
  5. Publish: Home → Publish → choose a workspace in the Service.
  6. Share: in the Service, share the report, publish an app, and set up scheduled refresh.
Remember: "Get data → Transform → Model → Visualise → Publish → Share". Interviewers love asking you to walk through this.

4. Data Sources & Connection Modes

In plain words

Power BI can read from hundreds of sources: files, databases, cloud services and websites. A connector is the built-in plug for each source.

The connection mode decides one big thing: does Power BI copy the data in, or ask the source every time?

Import is like downloading a movie: fast to watch, but it is a copy from that day. DirectQuery is like streaming: always the latest, but it depends on the internet speed.

Common sources

  • Files: Excel, CSV, JSON, XML, PDF, a whole folder of files.
  • Databases: SQL Server, MySQL, PostgreSQL, Oracle, Snowflake, Databricks.
  • Cloud / online: SharePoint, OneDrive, Azure SQL, Dataverse, Salesforce, Google Analytics, a web page.
  • Power BI / Fabric: existing semantic models, dataflows, lakehouses and warehouses.

The connection modes

ModeWhat happensGoodBad
ImportData is copied into the .pbix file and compressed.Fastest. All DAX and Power Query features work.Data is only as fresh as the last refresh. File size limits.
DirectQueryNo copy. Every click sends a query to the source.Always fresh. Works with huge data.Slower visuals. Some DAX and transforms are limited. Puts load on the source.
Live connectionConnects to an existing Power BI semantic model or Analysis Services model.One shared, trusted model for many reports.You can't change the model or use Power Query. You can add report-level measures only.
CompositeMix Import and DirectQuery tables in one model.Small tables imported (fast), big table live (fresh).More complex to design.
  • Direct Lake (Fabric only): reads Delta tables in OneLake directly. Nearly Import speed, without a full copy.
  • Storage mode for each table is set in Model view → table properties: Import, DirectQuery or Dual (can act as either).
Remember: Import by default. DirectQuery when data is huge or must be real-time. Live connection when a central team owns the model.
Part 2 — Power Query

5. Power Query Editor & Applied Steps

In plain words

Power Query is the cleaning tool inside Power BI (and Excel). You clean data by clicking buttons. Each click is saved as a step.

Next time data refreshes, Power BI repeats all the steps automatically. You never clean the same data twice.

Applied steps are like a recipe card. Once you write "wash, peel, cut", anyone can repeat it on new vegetables tomorrow.

Key points

  • Open it with Home → Transform data.
  • Left side: Queries (each one becomes a table). Middle: a preview of the data. Right side: Applied Steps.
  • Click any step to see the data at that moment. Click the ✕ to delete a step.
  • The formula bar shows the M code for each step. Turn it on in View → Formula bar.
  • Column quality / distribution / profile (View tab) show errors, empty values and unique counts. Great for spotting dirty data.
  • Query folding = Power Query turns your steps into one SQL query and lets the database do the work. Faster. Right-click a step → "View Native Query" to check.
  • Click Close & Apply to load the clean data into the model.

How to do it

  1. Get data → Excel → pick the Sales sheet → Transform Data (not Load).
  2. Check the first steps Power BI added: Source, Navigation, Promoted Headers, Changed Type.
  3. Add your own steps (next section).
  4. Rename steps to clear names, like "Removed blank rows". Right-click → Rename.
  5. Close & Apply.
Remember: Power QUERY = clean and shape (M language). DAX = calculate (after loading). Clean as early as possible, ideally in Power Query or at the source.

6. Common Transformations

In plain words

A transformation is one change to the data, like removing a column or fixing a date. These are the ones you will use every day.

It is like tidying a messy cupboard: throw out what you don't need, put labels on boxes, split mixed items into separate boxes.

The everyday list

TransformWhat it doesWhere to click
Remove columnsDrop columns you don't need. Smaller model, faster report.Home → Remove Columns (or Choose Columns)
Rename columnGive a clear name, e.g. cust_nm → Customer Name.Double-click the header
Change typeSet the data type: Whole number, Decimal, Date, Text, True/False.Click the icon left of the header
Remove rowsRemove top rows, blank rows, duplicates or errors.Home → Remove Rows
Replace valuesChange "N/A" to null, or "Nrth" to "North".Transform → Replace Values
Split column"Delhi-North" → "Delhi" and "North". By delimiter or number of characters.Home → Split Column
Trim / Clean / FormatRemove extra spaces, hidden characters, change UPPER/lower case.Transform → Format
Conditional columnNew column using IF-style rules, without code.Add Column → Conditional Column
Fill downCopy the value above into empty cells below.Transform → Fill → Down
Column from examplesType a few results; Power Query guesses the rule.Add Column → Column From Examples

Example: conditional column

Rule: if Qty ≥ 5 then "Bulk" else "Single". Result on our Sales table:

ProductQtyOrder Type (new)
Pen10Bulk
Notebook4Single
Bag1Single

Example: fill down

Excel exports often show a region only on the first row of a group. Fill down fixes it.

Before After fill down Region Product Region Product North Pen North Pen null Bag North Bag South Pen South Pen null Notebook South Notebook
Remember: always set the correct data type. A "number" stored as text can't be summed, and a text date can't use time intelligence.

7. Merge, Append, Pivot, Unpivot & Group By

In plain words

Append stacks tables on top of each other (more rows). Merge joins tables side by side using a matching column (more columns).

Append is like stapling January's attendance sheet under December's. Merge is like adding a "phone number" column next to each student by looking them up in another list.

Merge vs Append

Append QueriesMerge Queries
ResultMore rowsMore columns
NeedsSame column names in each tableA matching key column (e.g. ProductID)
SQL twinUNION ALLJOIN
ExampleSales_2024 + Sales_2025 → one Sales tableSales + Products → add Category to each sale
WhereHome → Append QueriesHome → Merge Queries, then expand the new column
  • Merge join kinds: Left outer (default: all rows from the first table), Right outer, Full outer, Inner (only matches), Left anti (rows with no match: great for finding missing data), Right anti.
  • Tip: in a good model you often don't need to merge. Keep Products as its own table and use a relationship instead.

Pivot and Unpivot

Unpivot turns many columns into rows. Pivot does the opposite. Power BI likes long, thin tables, so unpivot is used far more often.

Wide (bad for Power BI) Long (good) after Unpivot Product Jan Feb Mar Product Month Sales Pen 200 120 0 Pen Jan 200 Bag 0 900 0 Pen Feb 120 Pen Mar 0 Bag Jan 0 ...

How: select the Product column → Transform → Unpivot Columns → Unpivot Other Columns. This still works when new months are added later.

Group By

Group By makes a summary table, like a SQL GROUP BY. Example: total Qty per Region.

RegionTotal Qty
North11
South10
East8

How: Home → Group By → group by Region → new column "Total Qty", operation Sum, column Qty.

Remember: Append = stack rows (UNION). Merge = join columns (JOIN). Unpivot wide month columns into rows before you model.

8. M Language Basics

In plain words

M is the language behind Power Query. Every button you click writes a line of M. You rarely need to write it from scratch, but you should be able to read it.

M is like the receipt behind your shopping. You chose items by pointing (clicking). The receipt (M code) lists every item in order.

Key points

  • See all the code in Home → Advanced Editor.
  • A query is a let ... in block. Each line inside let is one step. in says which step is the final result.
  • Each step uses the step before it, by name.
  • M is case-sensitive. Table.SelectRows works; table.selectrows fails.
  • each [Qty] > 0 means "for each row, check Qty is greater than 0".
  • Step names with spaces are written like #"Changed Type".
let
    // 1. Read the CSV file
    Source = Csv.Document(File.Contents("C:\Data\sales.csv"), [Delimiter = ",", Encoding = 65001]),
    // 2. Use the first row as column names
    Promoted = Table.PromoteHeaders(Source, [PromoteAllScalars = true]),
    // 3. Set data types
    Typed = Table.TransformColumnTypes(Promoted,
        {{"Date", type date}, {"Qty", Int64.Type}, {"Price", type number}}),
    // 4. Keep only rows with Qty above 0
    Filtered = Table.SelectRows(Typed, each [Qty] > 0),
    // 5. Add Amount = Qty * Price
    Added = Table.AddColumn(Filtered, "Amount", each [Qty] * [Price], type number)
in
    Added
Remember: M = Power Query's language, step by step, case-sensitive. DAX = model formulas. Don't mix them up in an interview.
Part 3 — Data Modelling

9. Fact vs Dimension Tables

In plain words

A fact table stores events with numbers: each sale, each click, each payment. A dimension table stores descriptions: who, what, where, when.

A shop receipt roll is the fact table: thousands of sales. The product catalogue and the staff list are dimension tables: they describe the items and people on those receipts.

Key points

  • Fact: many rows, grows every day, mostly numbers and ID columns (keys). Example: Sales.
  • Dimension: fewer rows, mostly text, one row per thing. Example: Product, Store, Date, Customer.
  • You sum and count fact columns. You filter and group by dimension columns.
  • They are linked by a key: Sales[ProductID] matches Product[ProductID].
  • Granularity (grain) = what one row of the fact means. Example: "one row = one product in one order".

Our flat Sales table, split into a model

Sales (fact) Product (dimension) OrderDate | ProductID | StoreID | Qty | Price ProductID | Product | Category 2025-01-05| P1 | S1 | 10 | 20 P1 | Pen | Stationery 2025-02-15| P3 | S1 | 1 | 900 P3 | Bag | Accessories Store (dimension) Date (dimension) StoreID | City | Region Date | Year | Month | Quarter S1 | Delhi | North 2025-01-05 | 2025 | Jan | Q1

The rest of these notes use this model: Sales, Product, Store and 'Date'.

Remember: facts = numbers about events (what you add up). Dimensions = descriptions (what you slice by).

10. Star vs Snowflake Schema

In plain words

A schema is the shape of your model. In a star schema, one fact table sits in the middle, and each dimension links straight to it. In a snowflake, dimensions are split further into more tables.

A star is like a wheel: the hub (fact) with spokes (dimensions). A snowflake is a wheel where some spokes have extra small branches.

STAR SCHEMA SNOWFLAKE SCHEMA Date Product Sales fact Store Customer Date Customer Sales fact Product Category Store Region every dimension links straight to the fact some dimensions split into extra tables
Star schema (left) vs snowflake schema (right). The green links on the right are the extra "snowflake" branches.
StarSnowflake
ShapeFact + one layer of dimensionsDimensions split into sub-tables
Number of tablesFewerMore
Repeated textSome (e.g. "Stationery" repeats in Product)Less repetition
Speed in Power BIFaster, simpler DAXSlower, more relationships to follow
Recommended?Yes, Microsoft's adviceFlatten it into a star in Power Query

How to turn a snowflake into a star

  1. In Power Query, merge Category into Product (Merge Queries on CategoryID).
  2. Expand the Category Name column.
  3. Right-click the Category query → untick Enable load, so it doesn't load as a separate table.
Remember: star schema = best practice in Power BI. It is faster, easier to understand, and DAX works the way you expect.

11. Relationships, Cardinality & Filter Direction

In plain words

A relationship is a link between two tables using a matching column. It lets a filter on one table reach another table.

Cardinality says how many rows match on each side. Cross-filter direction says which way the filter can travel.

A relationship is like a one-way street sign. Filters are cars. A single-direction street lets cars go only from the dimension to the fact.

Employee Employee Details 1 1 One-to-one (1:1) one row to one row; rare Product Sales 1 * filter flows → One-to-many (1:*) one product, many sales Budget per Category Product Category repeats * * Many-to-many (*:*) both sides repeat; take care
The three cardinality types. One-to-many from a dimension to a fact is the normal, healthy case.

Cardinality

  • One-to-many (1:*): one row in Product matches many rows in Sales. The "one" side must have unique keys. This is 90% of relationships.
  • One-to-one (1:1): each row matches exactly one row. Usually means the two tables should be merged into one.
  • Many-to-many (*:*): neither side is unique. Example: a Budget table by Category joined to Product on Category. Works, but can give confusing totals. A bridge table (a table of unique keys in the middle) is often cleaner.

Cross-filter direction

  • Single (default, recommended): filters go from the "one" side (dimension) to the "many" side (fact). Picking "Pen" filters Sales.
  • Both (bi-directional): filters go both ways. Useful for some many-to-many cases, but can slow the model and cause ambiguity (more than one path between tables).
  • Prefer turning on "both" only inside one measure with CROSSFILTER(..., Both), instead of on the whole relationship.

Active vs inactive relationships

  • Only one active relationship can exist between two tables. It is a solid line in Model view.
  • Extra ones are inactive (dotted line). Example: Sales has OrderDate and ShipDate, both linked to 'Date'[Date].
  • Use an inactive one inside a measure with USERELATIONSHIP:
Sales by Ship Date =
CALCULATE (
    [Total Sales],
    USERELATIONSHIP ( Sales[ShipDate], 'Date'[Date] )   -- use the dotted line for this measure only
)

How to create a relationship

  1. Go to Model view.
  2. Drag Product[ProductID] onto Sales[ProductID].
  3. Double-click the line. Check cardinality (Many to one) and cross-filter direction (Single).
  4. Power BI may auto-detect relationships on load. Always check them.
Remember: one-to-many, single direction, from dimension to fact. Use USERELATIONSHIP for a second date, and avoid "both" unless you really need it.

12. The Date (Calendar) Table

In plain words

A date table is a dimension with one row for every day, with no gaps. It has helper columns like Year, Month and Quarter.

It is like a wall calendar. Even days with no sales still have a box on it. Time formulas need every box to be there to count backwards and forwards.

Key points

  • Time intelligence functions (YTD, last year) need a proper date table to work correctly.
  • Rules: one row per date, unique dates, no blanks, no gaps. Best to cover whole years.
  • CALENDAR(start, end) makes dates between two dates you choose.
  • CALENDARAUTO() looks at all dates in your model and makes full years that cover them.
  • Turn off Auto date/time (File → Options → Data Load). It creates hidden date tables for every date column and makes the file bigger.
Date =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2024, 1, 1 ), DATE ( 2025, 12, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month No", MONTH ( [Date] ),
    "Month", FORMAT ( [Date], "MMM" ),
    "Quarter", "Q" & QUARTER ( [Date] ),
    "Weekday", FORMAT ( [Date], "ddd" )
)

How to do it

  1. Modeling → New table → paste the formula above.
  2. Select the table → Table tools → Mark as date table → choose the Date column.
  3. Select the Month column → Sort by column → Month No. Otherwise months sort A–Z (Apr, Aug, Dec…).
  4. Create a relationship: 'Date'[Date] (one) → Sales[OrderDate] (many).
  5. Always use 'Date' columns in visuals and slicers, not Sales[OrderDate].
Remember: make a date table, mark it as a date table, sort months by month number, and link it to the fact. Say these four steps in interviews.
Part 4 — DAX

13. DAX Basics: Calculated Column vs Measure vs Calculated Table

In plain words

DAX (Data Analysis Expressions) is the formula language of Power BI. It looks a bit like Excel formulas, but it works on whole tables and columns, not single cells.

You can use DAX to make three things: a calculated column, a measure, or a calculated table.

A calculated column is like writing a value on every receipt in a pile. A measure is like a calculator you use when someone asks a question. It works out the answer only when needed.

Calculated columnMeasureCalculated table
What it makesA new column in a tableOne number (a summary)A whole new table
When it is calculatedAt refresh, row by rowAt query time, when a visual needs itAt refresh
Stored in the file?Yes, uses memoryNo, only the formulaYes, uses memory
Reacts to slicers?No (values are fixed)YesNo
ContextRow contextFilter context—
ExampleAmount = Sales[Qty] * Sales[Price]Total Qty = SUM(Sales[Qty])Date = CALENDARAUTO()
Use it forSlicing, grouping, filtering by a value per row (e.g. "Bulk"/"Single")Totals, %, averages, KPIsDate tables, helper tables

Key points

  • Syntax: Name = expression. Columns are written Table[Column]. Measures are written [Measure].
  • Table names with spaces or reserved words need quotes: 'Date'[Year].
  • Prefer measures. They don't use memory and they respond to every filter.
  • Keep measures in one empty table called _Measures so they are easy to find.
  • Comments: -- or // for one line, /* */ for many lines.
  • An implicit measure is when you drag a number column and Power BI sums it for you. An explicit measure is one you write. Write explicit ones; they are reusable.
Remember: if you need to slice or filter by it, use a column. If you need to add it up and see it change with filters, use a measure.

14. Row Context vs Filter Context

In plain words

Row context means "I am looking at one row right now". Filter context means "these filters are active right now, so only some rows are visible".

Row context is a teacher marking one exam paper at a time. Filter context is the principal saying "show me only Class 10, Section B" before anyone counts anything.

Row context

  • Exists in calculated columns and inside iterator functions like SUMX.
  • Lets you write Sales[Qty] * Sales[Price]: "this row's Qty times this row's Price".
  • Row context does not filter anything by itself.

Filter context

  • Comes from everything around a visual cell: slicers, rows/columns of a matrix, chart axes, the Filters pane, cross-filtering from other visuals, and RLS.
  • Every measure is calculated inside a filter context. That's why the same measure shows a different number in every cell.
  • CALCULATE is the function that changes filter context.
Slicer Year = 2025 Matrix row Region = North Filter context 2025 AND North Sales table only matching rows stay [Total Sales] runs on the rows that are left the cell for North shows 52,400
Every cell of a visual has its own filter context. The measure formula is the same; only the visible rows change.

Example

A matrix with Region on rows, and the measure Total Qty = SUM(Sales[Qty]):

Region (filter context)Total Qty
North → only North rows visible11
South → only South rows visible10
East → only East rows visible8
Total → no Region filter29

Context transition (one line): when CALCULATE runs inside a row context, it turns the current row into a filter. A measure used in a calculated column does this automatically.

Remember: row context = "this row" (columns, iterators). Filter context = "these filters" (visuals, slicers). CALCULATE changes the filter context.

15. Aggregations & Iterators (SUM vs SUMX)

In plain words

Aggregation functions squash a column into one number: SUM, AVERAGE, COUNT. Iterator functions (ending in X) go row by row, do a calculation on each row, and then squash the results.

SUM is adding up the totals already printed on receipts. SUMX is going through each receipt, multiplying quantity by price yourself, and then adding those up.

The basic aggregators

FunctionWhat it doesOn our Sales table
SUM(Sales[Qty])Adds a column29
AVERAGE(Sales[Price])Average of a column212
MIN / MAXSmallest / largest valueMAX(Price) = 900
COUNT(Sales[Qty])Counts non-blank values in a column5
COUNTROWS(Sales)Counts rows in a table5
DISTINCTCOUNT(Sales[Product])Counts unique values3 (Pen, Notebook, Bag)
COUNTBLANKCounts empty cells0

Iterators: SUMX, AVERAGEX, COUNTX, MAXX…

  • Syntax: SUMX(table, expression). It creates a row context on the table.
  • You can't write SUM(Sales[Qty] * Sales[Price]). SUM takes only one column. Use SUMX.
  • Iterators don't need a stored "Amount" column, so the model stays smaller.
Total Qty = SUM ( Sales[Qty] )

-- Row by row: Qty * Price, then add all results
Total Sales = SUMX ( Sales, Sales[Qty] * Sales[Price] )
-- 200 + 240 + 120 + 900 + 480 = 1,940

Orders = COUNTROWS ( Sales )

Avg Sale per Order = AVERAGEX ( Sales, Sales[Qty] * Sales[Price] )   -- 1,940 / 5 = 388

Unique Products = DISTINCTCOUNT ( Sales[ProductID] )
Remember: SUM adds one column. SUMX calculates an expression on each row first, then adds. Use COUNTROWS to count rows, DISTINCTCOUNT for unique items.

16. CALCULATE & FILTER

In plain words

CALCULATE is the most important DAX function. It means: "work out this measure, but with these filters changed".

FILTER returns a smaller table: only the rows that pass a test.

CALCULATE is like asking a shopkeeper: "What were total sales, but only for the North branch?" The question is the same; you just changed the condition.

Key points

  • Syntax: CALCULATE(expression, filter1, filter2, ...). Many filters are joined with AND.
  • A simple filter like Store[Region] = "North" replaces any existing filter on that column.
  • To keep the existing filter and add yours on top, wrap it in KEEPFILTERS(...).
  • FILTER(table, condition) goes row by row (an iterator). Use it when the condition is complex, like comparing a measure or two columns.
  • Don't use FILTER on a whole big fact table when a simple column filter will do. It is slower.
-- Sales only for the North region
North Sales =
CALCULATE ( [Total Sales], Store[Region] = "North" )

-- Two conditions (AND)
North Pen Sales =
CALCULATE ( [Total Sales], Store[Region] = "North", Product[Product] = "Pen" )

-- OR inside one column
North or South Sales =
CALCULATE ( [Total Sales], Store[Region] IN { "North", "South" } )

-- FILTER for a row-level condition: only big orders (amount over 1,000)
Big Order Sales =
CALCULATE (
    [Total Sales],
    FILTER ( Sales, Sales[Qty] * Sales[Price] > 1000 )
)

-- Count products that sold more than 500 in total (FILTER over a measure)
Top Products Count =
COUNTROWS ( FILTER ( VALUES ( Product[Product] ), [Total Sales] > 500 ) )
Remember: CALCULATE = "same measure, different filters". It is the answer to half of all DAX interview questions.

17. ALL, ALLEXCEPT & REMOVEFILTERS

In plain words

These functions remove filters. You need them for things like "% of total", where you must compare a part with the whole.

Filters are like blinkers on a horse. ALL takes the blinkers off, so the measure can see the whole field, not just its own lane.

Key points

  • ALL(table) or ALL(column): ignore all filters on that table or column.
  • ALLEXCEPT(table, column): ignore all filters on the table except the columns you list.
  • REMOVEFILTERS(...): same as ALL when used inside CALCULATE. Newer and clearer name.
  • ALLSELECTED(...): ignore filters from inside the visual, but keep slicer/page filters. Good for "% of what is shown".
  • ALL can also return a table (e.g. for RANKX). REMOVEFILTERS can only be used as a CALCULATE filter.
-- Total for all regions, no matter what is selected
All Region Sales =
CALCULATE ( [Total Sales], REMOVEFILTERS ( Store[Region] ) )

-- % of total across regions
Region % of Total =
DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALL ( Store[Region] ) ) )

-- % of the product's own category (keep Category filter, drop the rest of Product)
% of Category =
DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALLEXCEPT ( Product, Product[Category] ) ) )

Result in a matrix

RegionTotal SalesAll Region SalesRegion % of Total
North1,1001,94056.7%
South3601,94018.6%
East4801,94024.7%
Total1,9401,940100%
Remember: part ÷ whole. The "whole" is CALCULATE with ALL or REMOVEFILTERS. ALLEXCEPT keeps the columns you name.

18. RELATED & RELATEDTABLE

In plain words

These functions follow a relationship to fetch data from another table, inside a row context.

RELATED goes from the many side to the one side (fetch one value). RELATEDTABLE goes from the one side to the many side (fetch all matching rows).

RELATED is like looking up a student's class teacher: one answer. RELATEDTABLE is like asking a teacher for the list of all her students: many rows.

Key points

  • Both need an existing relationship between the tables.
  • Used in calculated columns or inside iterators like SUMX (they need a row context).
  • RELATED works like Excel's VLOOKUP, but it uses the relationship, so it is safer.
-- Calculated column in Sales (many side): fetch the product's category
Category = RELATED ( Product[Category] )

-- Calculated column in Product (one side): how many sales rows each product has
Order Count = COUNTROWS ( RELATEDTABLE ( Sales ) )

-- Measure: sales using a price stored in the Product table
Sales at List Price =
SUMX ( Sales, Sales[Qty] * RELATED ( Product[ListPrice] ) )
Remember: RELATED = many → one (one value). RELATEDTABLE = one → many (a table). Both need a relationship.

19. IF, SWITCH, DIVIDE & VAR / RETURN

In plain words

IF and SWITCH make decisions. DIVIDE divides safely. VAR saves a result in a named box so you can reuse it.

VAR is like writing a number on a sticky note while doing maths, so you don't have to work it out again for the next step.

Key points

  • IF(condition, value_if_true, value_if_false). Same idea as Excel.
  • SWITCH replaces many nested IFs. SWITCH(TRUE(), ...) checks conditions from top to bottom and takes the first true one.
  • DIVIDE(a, b, alternate) returns BLANK (or your alternate value) when b is 0. The / operator gives an error (infinity) instead.
  • VAR stores a value. RETURN gives the final answer. Variables are calculated once, so code is faster and easier to read.
  • Logic operators: && = AND, || = OR. & joins text.
-- IF
Sales Status = IF ( [Total Sales] >= 1000, "On target", "Below target" )

-- SWITCH(TRUE()) for bands
Sales Band =
SWITCH (
    TRUE (),
    [Total Sales] >= 100000, "High",
    [Total Sales] >= 50000, "Medium",
    "Low"                                   -- default if nothing matched
)

-- Safe division
Avg Price = DIVIDE ( [Total Sales], [Total Qty], 0 )

-- VAR / RETURN: profit margin
Profit Margin % =
VAR Revenue = [Total Sales]
VAR Cost = SUMX ( Sales, Sales[Qty] * RELATED ( Product[UnitCost] ) )
RETURN
    DIVIDE ( Revenue - Cost, Revenue )
Remember: always use DIVIDE instead of "/" in measures, use SWITCH(TRUE()) instead of deep IFs, and use VAR to make long measures clean.

20. Time Intelligence

In plain words

Time intelligence functions compare numbers over time: year-to-date, same month last year, growth %. They need a marked date table.

It is like a school report card that shows this term's marks next to last term's, so you can see if you improved.

Key functions

FunctionMeaning
TOTALYTD(expr, 'Date'[Date])Year-to-date total (from 1 Jan to the current date in context). Also TOTALQTD, TOTALMTD.
DATESYTD('Date'[Date])The YTD dates as a table, for use inside CALCULATE.
SAMEPERIODLASTYEAR('Date'[Date])The same dates, one year back.
DATEADD('Date'[Date], -1, MONTH)Shift dates by any number of DAY, MONTH, QUARTER or YEAR.
PREVIOUSMONTH / PREVIOUSYEARThe whole previous month / year.
DATESINPERIODA rolling window, e.g. last 3 months.
Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )

-- Fiscal year ending 31 March (common in India)
Sales FYTD = TOTALYTD ( [Total Sales], 'Date'[Date], "3-31" )

Sales LY = CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

Sales LM = CALCULATE ( [Total Sales], DATEADD ( 'Date'[Date], -1, MONTH ) )

-- Year-over-year growth %
YoY % =
VAR CurrentSales = [Total Sales]
VAR LastYearSales = [Sales LY]
RETURN
    DIVIDE ( CurrentSales - LastYearSales, LastYearSales )

-- Rolling 3 months
Sales Rolling 3M =
CALCULATE (
    [Total Sales],
    DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -3, MONTH )
)

YoY example

MonthTotal Sales (2025)Sales LY (2024)YoY %
Jan44,00040,00010.0%
Feb38,00040,000-5.0%
Mar50,000(blank)(blank) — no data last year
  • Format YoY % as a percentage (Measure tools → Format → Percentage).
  • Newer Power BI versions also have calendar-based time intelligence (preview since late 2025) for custom calendars like 4-4-5 retail weeks. The classic functions above are still what interviews ask.
Remember: marked date table + CALCULATE + a time function. YoY % = (This year − Last year) ÷ Last year, written with VAR and DIVIDE.

21. RANKX

In plain words

RANKX gives a rank number (1, 2, 3…) to each item, based on a measure. Example: rank products by sales.

It is like a class result list. Everyone's marks are compared with everyone else's, and the top scorer gets rank 1.

Key points

  • Syntax: RANKX(table, expression, [value], [order], [ties]).
  • The table is usually ALL(Product[Product]). Without ALL, each row only sees itself and every product gets rank 1. This is the classic mistake.
  • Order: DESC (default, highest = 1) or ASC.
  • Ties: Skip (default: 1, 2, 2, 4) or Dense (1, 2, 2, 3).
  • For a "Top 5" visual you can also use the visual-level Top N filter, no DAX needed.
  • Newer window functions like RANK, WINDOW and OFFSET also exist. RANKX is still the one interviews expect.
Product Rank =
RANKX ( ALL ( Product[Product] ), [Total Sales], , DESC, Dense )

-- Show sales only for the top 3 products, blank for others
Top 3 Sales =
IF ( [Product Rank] <= 3, [Total Sales] )
ProductTotal SalesProduct Rank
Bag9001
Notebook7202
Pen3203
Remember: RANKX needs ALL around the table. Otherwise everything is rank 1.
Part 5 — Visuals & Reports

22. Choosing Visuals

In plain words

A visual is any chart, table, card or map on a report page. Pick the visual based on the question you want to answer.

Choosing a visual is like choosing a container. Soup goes in a bowl, not on a plate. Trends go in a line chart, not a pie chart.

QuestionBest visual
What is one big number? (Total Sales)Card / KPI visual
How does it change over time?Line chart, area chart
Which category is bigger?Bar / column chart (bars for long names)
What is the share of a whole? (few parts)Donut / pie (max 4–5 slices), or 100% stacked bar
Where does it happen?Map (Azure Maps), filled map, shape map
How do two numbers relate?Scatter chart
What adds up to the total step by step?Waterfall
Are we on target?Gauge, KPI visual
What drives the number?Key influencers, decomposition tree (AI visuals)
Exact numbers to readTable or matrix

Key points

  • Card: shows one number. The newer card visual can show several numbers in one box.
  • Slicer: an on-page filter (list, dropdown, date range, buttons). Users click it to filter the page.
  • Table vs matrix: a table is a flat list (like Excel rows). A matrix is a pivot table: rows and columns, subtotals, and it can expand/collapse levels.
  • Maps: Microsoft is replacing the older Map and Filled map visuals with Azure Maps. Map data needs clear location columns; set the Data category (City, Country) in Column tools.
  • Custom visuals: extra visuals from AppSource (Get more visuals), or a .pbiviz file. Prefer certified ones (checked by Microsoft).
  • Python and R visuals exist too, for special charts.
  • Keep pages simple: 5–8 visuals, important KPIs at the top-left, consistent colours. Use a theme (View → Themes).
Remember: line for time, bar for comparing, card for one number, matrix for pivot-style detail. Avoid pies with many slices.

23. Interactions, Hierarchies, Drill-down & Drill-through

In plain words

Interactions: clicking one visual filters the others. A hierarchy is a ladder of levels like Year → Quarter → Month. Drill-down moves down that ladder inside the same visual. Drill-through jumps to a different page with details.

Drill-down is zooming in on a map: country → state → city. Drill-through is clicking a city to open its own detailed guide book.

Interactions

  • Default: click a bar → other visuals cross-highlight or cross-filter.
  • Change it: select a visual → Format → Edit interactions. On each other visual choose Filter, Highlight or None.
  • Ctrl + click selects many items.
  • Sync slicers (View → Sync slicers) makes one slicer work across many pages.
  • Filter levels in the Filters pane: visual, page, all pages (report). Plus drill-through filters.

Hierarchies and drill-down

  • Create a hierarchy: in the Data pane, right-click Year → Create hierarchy → drag Quarter and Month into it.
  • Or just put several fields in a visual's axis: Category, then Product.
  • Drill icons on the visual: ↓ (turn on drill mode, then click a bar), ⇊ (next level for all), ⤓ (expand all down one level), ↑ (drill up).

Drill-through: how to do it

  1. Create a new page called "Product Details".
  2. Drag Product[Product] into the page's Drill through box (in the Visualizations pane).
  3. Power BI adds a Back button automatically.
  4. On any other page, right-click a bar for "Pen" → Drill through → Product Details.
  5. The details page opens, filtered to Pen.
Remember: drill-down = deeper level, same visual. Drill-through = another page, filtered to what you clicked.

24. Bookmarks, Tooltip Pages & Conditional Formatting

In plain words

A bookmark saves how a page looks right now (filters, visible visuals). A tooltip page is a mini report that pops up when you hover. Conditional formatting changes colours based on values.

A bookmark is like a saved camera angle. Press the button and you are back to the exact same view.

Bookmarks

  • View → Bookmarks pane → set up the page → Add.
  • Use with buttons: Insert → Button → Action → Type: Bookmark.
  • Common uses: "Reset filters" button, toggle between chart and table, show/hide a help panel (with the Selection pane).
  • Each bookmark can choose to save Data (filters), Display (visible visuals) and Current page.
  • Personal bookmarks in the Service let viewers save their own views.

Tooltip pages: how to do it

  1. Add a new page. In Format page → Page information, turn on Allow use as tooltip.
  2. Set Canvas settings → Type: Tooltip (small size).
  3. Add small visuals to it, e.g. a monthly sales line.
  4. On the main visual: Format → General → Tooltips → Type: Report page → choose your page.
  5. Hover a bar: the mini page appears, filtered to that bar.

Conditional formatting

  • On a table/matrix: select the field in the Values well → down arrow → Conditional formatting.
  • Types: background colour, font colour, data bars, icons (arrows, traffic lights), web URL.
  • Format by: Gradient (colour scale), Rules (e.g. < 0 red, ≥ 0 green), or Field value (a measure that returns a colour name or hex code).
-- Measure returning a colour, used with "Format by: Field value"
YoY Colour = IF ( [YoY %] < 0, "#D64545", "#2F6F4E" )
Remember: bookmarks + buttons make reports feel like apps. Tooltip pages give detail on hover. Conditional formatting makes problems jump out.

25. Parameters: What-if & Field Parameters

In plain words

A parameter lets the report user change a value or a field with a slicer. What-if parameters change a number. Field parameters change which column or measure a visual shows.

A what-if parameter is like a volume knob: turn it, and the sound changes. A field parameter is like a TV remote: switch the channel, and the screen shows a different show.

What-if parameter

  1. Modeling → New parameter → Numeric range.
  2. Name "Discount", min 0, max 0.5, increment 0.05. Tick "Add slicer to this page".
  3. Power BI creates a table, a slicer and a measure for you.
  4. Use the value in your own measure.
-- Created by Power BI
Discount = GENERATESERIES ( 0, 0.5, 0.05 )
Discount Value = SELECTEDVALUE ( Discount[Discount], 0 )

-- Your measure
Sales After Discount = [Total Sales] * ( 1 - [Discount Value] )

Field parameter

  1. Modeling → New parameter → Fields.
  2. Pick fields, e.g. Product[Category], Store[Region], 'Date'[Month].
  3. Power BI adds a slicer. Put the parameter on a chart's axis.
  4. Users pick "Region" in the slicer and the chart switches to show sales by Region.
  • Field parameters can also switch measures: Sales / Qty / Profit with one slicer.
  • Power Query also has query parameters (Home → Manage Parameters), e.g. a server name used in the Source step. Different from these report parameters.
Remember: what-if = change a number (scenario). Field parameter = change what the visual shows (dynamic axis or measure).
Part 6 — Service, Security & Sharing

26. Row-Level Security (RLS)

In plain words

Row-Level Security means different people see different rows in the same report. The North manager sees only North data.

It is like a hotel key card. Everyone enters the same building, but each card opens only its own room.

Key points

  • You create roles with DAX filter rules on tables. The filter flows through relationships to the facts.
  • Static RLS: the value is fixed in the rule. One role per region: "North", "South"…
  • Dynamic RLS: one rule for everyone, using USERPRINCIPALNAME(), which returns the logged-in user's email.
  • RLS applies to people with the Viewer role. Workspace Admins, Members and Contributors bypass RLS.
  • Object-Level Security (OLS) hides whole tables or columns (set up with external tools like Tabular Editor).

Static RLS

-- Role "North" — rule on the Store table
[Region] = "North"

Dynamic RLS

Add a small mapping table that says which user sees which region:

EmailRegion
asha@company.comNorth
ravi@company.comSouth
-- Role "Regional Manager" — rule on the UserRegion table
-- Relationship: UserRegion[Region] → Store[Region] (filter must reach Store and Sales)
[Email] = USERPRINCIPALNAME ()

Simpler version when the email is already on the Store table: rule on Store is [ManagerEmail] = USERPRINCIPALNAME().

How to do it

  1. Desktop: Modeling → Manage roles → New role → pick a table → write the DAX rule.
  2. Test: Modeling → View as → choose a role (and "Other user" for an email).
  3. Publish.
  4. Service: semantic model → ⋯ → Security → add people or groups to each role.
Remember: RLS = filter rows by role. Static = fixed value. Dynamic = USERPRINCIPALNAME() plus a user mapping table. Roles are created in Desktop, people are added in the Service.

27. Power BI Service & Licences

In plain words

The Power BI Service (app.powerbi.com) is the cloud website where reports live after you publish them. Teams share, refresh and view them there.

Desktop is your laptop where you write a document. The Service is the shared office drive where everyone can open the final version.

The main items

  • Workspace: a shared folder for a team's content. My workspace is your private one.
  • Workspace roles: Admin (everything), Member (edit + share), Contributor (edit), Viewer (only view).
  • Semantic model (old name: dataset): the data + relationships + measures you published. Many reports can use one semantic model.
  • Report: the pages of visuals. Dashboard: one page of pinned tiles (next section).
  • Dataflow: Power Query in the cloud. Clean once, reuse in many models.
  • App: a packaged, read-only bundle of reports and dashboards from a workspace. The best way to share with large groups of viewers.
  • Deployment pipelines: move content from Development → Test → Production.
  • Endorsement: mark a semantic model as Promoted or Certified so people trust it.

Ways to share

  1. Workspace access: add colleagues to the workspace with a role. Good for the team that builds.
  2. Share a report link with specific people. Good for a few people.
  3. Publish an app: best for many viewers (whole department).
  4. Embed in Teams, SharePoint or a website.
  5. Publish to web: anyone on the internet can see it. Never use it for company data.
  6. Also: Analyze in Excel, export to PDF/PowerPoint, email subscriptions, data alerts on dashboard tiles.

Licences at a glance

LicenceWhat you getNote
FreeUse Desktop. Publish only to My workspace. Can't share.Can view content that sits on Fabric capacity F64 or larger.
ProShare and collaborate in workspaces. 1 GB model size, 8 refreshes per day.Per user, per month. Both the sharer and the viewer need Pro (unless capacity).
Premium Per User (PPU)Premium features for one user: bigger models, 48 refreshes/day, deployment pipelines, paginated reports.Per user. Viewers need PPU too.
Fabric capacity (F SKUs)The organisation buys computing power. All Fabric workloads.From F64 upward, free users can view Power BI content. Old Premium P SKUs are being replaced by F SKUs.

Prices change, so check Microsoft's pricing page. In 2025, Pro was about $14 and PPU about $24 per user per month.

Remember: semantic model = the data, report = the pages, app = the way to share with many. Free can't share, Pro can, capacity lets free users view.

28. Reports vs Dashboards

In plain words

A report is many pages of interactive visuals from one semantic model. A dashboard is one page of tiles that you pin from one or more reports. Dashboards exist only in the Service.

A report is a full newspaper with many pages. A dashboard is the front page summary, with headlines cut out from different sections.

Report A 3 pages, 1 semantic model slicers, drill, filters Report B 2 pages, another model slicers, drill, filters Dashboard (one page) Sales card from A Trend line from A Stock level from B Live tile from B pin visuals Report = explore and filter. Dashboard = one-page summary of pinned tiles (Service only).
Reports hold the detail. Dashboards collect key tiles from many reports. Clicking a tile opens the report it came from.
ReportDashboard
PagesOne or manyOnly one
Data sourceOne semantic modelTiles from many reports and models
Where madeDesktop and ServiceService only
InteractivityFull: slicers, cross-filter, drillLimited: no slicers; click a tile to open its report
Data alertsNoYes (on card, KPI, gauge tiles)
Q&A boxAs a visualBuilt in at the top
Best forAnalysts digging into detailsManagers checking key numbers at a glance
Remember: report = many pages, one model, fully interactive. Dashboard = one page, many sources, pinned tiles, Service only, supports alerts.

29. Refresh & Gateways

In plain words

Refresh means re-loading the latest data into an Import model. Scheduled refresh does it automatically at set times. A gateway is a small program that lets the cloud Service reach data inside your office network.

A gateway is like a security guard at the office gate. The cloud can't walk in. The guard carries the data out to it, safely.

Your office network Microsoft cloud SQL Server on-premises Data gateway on an office PC Power BI Service semantic model Azure SQL cloud source encrypted, outbound no gateway needed Scheduled refresh: up to 8 a day on Pro, up to 48 a day on PPU or capacity The gateway machine must be switched on and online when refresh runs.
A gateway is needed only for data the cloud can't reach directly: on-premises databases, files on a local drive or network share.

Key points

  • Import models need refresh. DirectQuery and live connections don't store data, so they show fresh data on each click (but on-premises DirectQuery still needs a gateway).
  • On-premises data gateway (standard mode): shared by many users, managed centrally. Recommended for companies.
  • Personal mode: only for one user, Import only. Fine for learning.
  • VNet data gateway: a Microsoft-managed gateway for data inside Azure private networks.
  • Cloud sources (SharePoint Online, OneDrive, Azure SQL) don't need a gateway.
  • Incremental refresh: refresh only new data (e.g. last 7 days) instead of the full history. Uses RangeStart and RangeEnd parameters.
  • Refresh history and failure emails help you catch problems (wrong password, gateway offline).

How to set up scheduled refresh

  1. Install the gateway on an always-on machine in the office and sign in.
  2. In the Service: Settings → Manage connections and gateways → add a data source connection with credentials.
  3. Open the semantic model → Settings → Gateway and cloud connections → map the source to the gateway.
  4. Turn on Scheduled refresh, choose time zone and times (e.g. 7 AM daily).
Remember: cloud data → no gateway. On-premises data → gateway. Import → schedule refreshes (8/day Pro, 48/day PPU or capacity).
Part 7 — Practice

30. Performance Tips

In plain words

A slow report makes people stop using it. Most speed problems come from too much data, a messy model, or heavy DAX.

A slow report is like a heavy school bag. Take out books you don't need today (columns), organise the rest (star schema), and it gets light again.

Find the problem first

  • Performance Analyzer (Optimize tab → Performance analyzer; older versions: View tab). Click Start recording, then Refresh visuals.
  • It shows time for each visual: DAX query, Visual display, and Other (waiting). Copy the query to DAX Studio for deeper checks.
  • Tools like DAX Studio (VertiPaq Analyzer) show which columns use the most memory.

Model tips

  • Remove unused columns and rows. The best data is data you don't load.
  • Use a star schema. Avoid many-to-many and bi-directional filters.
  • Columns with few unique values compress well. Split date-time into separate date and time columns; round long decimals.
  • Turn off Auto date/time.
  • Use correct data types. Whole numbers compress better than text.
  • Keep query folding working in Power Query.

DAX and report tips

  • Prefer measures over calculated columns.
  • Use VAR so a value is calculated once.
  • Filter columns, not whole tables: CALCULATE([Sales], Store[Region] = "North") instead of FILTER(Sales, ...).
  • Use DIVIDE, and avoid deep IF chains with SWITCH.
  • Fewer visuals per page. Each visual sends its own query.
  • Use aggregations or Import for summary tables when the fact is huge in DirectQuery.
Remember: measure first with Performance Analyzer. Then: fewer columns, star schema, measures over calculated columns, simple filters.

31. Power BI vs Tableau vs Excel

In plain words

All three can make charts. They are built for different jobs. Interviewers ask this to see if you understand when to use each tool.

Excel is a Swiss army knife. Power BI and Tableau are professional kitchen knives: better for the main job, less good for everything else.

Power BITableauExcel
Made byMicrosoftSalesforceMicrosoft
Best forCompany dashboards, Microsoft-based teamsRich, flexible visual explorationQuick analysis, small data, financial models
Data sizeMillions to billions of rows (compressed model)Very large (extracts / live)About 1 million rows per sheet (more with Power Pivot)
Formula languageDAX + MCalculated fields, LOD expressionsExcel formulas (also Power Query and DAX via Power Pivot)
CostLow (free Desktop, Pro per user)Higher per userPart of Microsoft 365
Learning curveEasy start, DAX gets harderEasy drag and drop, strong visualsEasiest; most people know it
SharingPower BI Service, apps, TeamsTableau Server / CloudSend files, SharePoint
Desktop OSWindows onlyWindows and MacWindows and Mac
Remember: a good answer: "Power BI for shared, refreshable company reports in a Microsoft setup; Tableau for very flexible visual exploration; Excel for quick, small, ad-hoc work." Don't say one is simply "best".

32. End-to-End: A Sales Dashboard

In plain words

This is a short walk-through of a complete project. Practise it once yourself, then explain it in interviews as your project.

Like a cooking show: here are the ingredients, here are the steps, here is the finished dish.

The task

"The sales head wants to see total sales, growth vs last year, best products, and sales by region, with a filter for year and region. Data is in Excel files and refreshed daily."

Step by step

  1. Get data: Get data → Folder → the folder of monthly Excel files → Combine & Transform. Also load the Products and Stores sheets.
  2. Transform: remove empty rows, set data types (Date, Whole number, Decimal), trim text, fix "Nrth" → "North", remove unused columns.
  3. Model: create the 'Date' table with CALENDARAUTO, mark it as a date table. Relationships: Date, Product and Store (one) → Sales (many), single direction. Star schema.
  4. Measures (in a _Measures table):
Total Sales = SUMX ( Sales, Sales[Qty] * Sales[Price] )
Total Qty = SUM ( Sales[Qty] )
Orders = COUNTROWS ( Sales )
Avg Order Value = DIVIDE ( [Total Sales], [Orders] )
Sales LY = CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
YoY % = DIVIDE ( [Total Sales] - [Sales LY], [Sales LY] )
Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )
Product Rank = RANKX ( ALL ( Product[Product] ), [Total Sales], , DESC, Dense )
  1. Visualise (one main page):
    • Top row: 4 cards — Total Sales, Orders, Avg Order Value, YoY %.
    • Line chart: Total Sales and Sales LY by Month.
    • Bar chart: Top 5 products (Top N filter on Total Sales).
    • Map or bar: Sales by Region.
    • Matrix: Category → Product with Total Sales and YoY %, conditional formatting red/green.
    • Slicers: Year and Region, synced across pages.
  2. Extras: a drill-through page "Product Details", a tooltip page with the monthly trend, a "Reset filters" bookmark button.
  3. Security: dynamic RLS so each regional manager sees only their region.
  4. Publish to a "Sales" workspace. Put the Excel folder on SharePoint (no gateway needed) or set up a gateway for a local folder.
  5. Refresh: scheduled daily at 7 AM.
  6. Share: publish an app for the sales team. Pin the cards to a dashboard and add a data alert if YoY % drops below 0.

Insights to talk about

  • "North gave 57% of sales, mainly from one expensive product (Bag)."
  • "February sales fell 5% vs last year; Pen sales dropped in South."
  • "I would suggest a promotion on Notebooks in East, the fastest-growing region."
Remember: in interviews, describe a project as: problem → data → cleaning → model → key measures → visuals → sharing → one business insight. The insight is what makes you stand out.
Revision

Quick Revision

The most-asked Power BI questions, with short and simple answers. Say these in your own words.

Basics

  • What is Power BI? A Microsoft BI tool to connect, clean, model, visualise and share data as interactive reports.
  • Main components? Desktop (build), Service (share), Mobile (view), Report Server (on-premises).
  • What is the workflow? Get data → Transform → Model → Visualise → Publish → Share.
  • Import vs DirectQuery? Import copies data (fast, needs refresh). DirectQuery asks the source each time (fresh, slower).
  • What is a live connection? Connecting to an existing semantic model or Analysis Services. You can't edit the model.
  • What is a composite model? A model mixing Import and DirectQuery tables.
  • What is Microsoft Fabric? Microsoft's all-in-one data platform; Power BI is one part of it.

Power Query

  • Power Query vs DAX? Power Query (M) cleans and shapes data before loading. DAX calculates after loading.
  • What are applied steps? The saved list of transformations, repeated on every refresh.
  • Merge vs Append? Merge = join columns (like SQL JOIN). Append = stack rows (like UNION).
  • What is unpivot? Turning many columns (Jan, Feb, Mar) into rows (Month, Value).
  • What is query folding? Power Query sending your steps back to the source as one query, so the source does the work.

Modelling

  • Fact vs dimension? Fact = events with numbers (Sales). Dimension = descriptions (Product, Date).
  • Star vs snowflake? Star = dimensions link straight to the fact. Snowflake = dimensions split further. Star is best in Power BI.
  • Types of cardinality? One-to-one, one-to-many (most common), many-to-many.
  • Single vs both direction? Single = filter flows dimension → fact (default). Both = flows both ways; use carefully.
  • Active vs inactive relationship? Only one active between two tables. Use an inactive one with USERELATIONSHIP.
  • Why a date table? Time intelligence needs one row per day, no gaps. Mark it as a date table.

DAX

  • Calculated column vs measure? Column = stored, per row, fixed. Measure = calculated at query time, reacts to filters.
  • Row vs filter context? Row = "this row". Filter = "these filters are on".
  • SUM vs SUMX? SUM adds one column. SUMX calculates per row, then adds.
  • COUNT vs COUNTROWS vs DISTINCTCOUNT? Non-blank values in a column / rows in a table / unique values.
  • What does CALCULATE do? Evaluates an expression with changed filters.
  • ALL vs ALLEXCEPT? ALL removes all filters. ALLEXCEPT removes all except the columns you name.
  • RELATED vs RELATEDTABLE? Many → one value / one → many rows.
  • Why DIVIDE? It handles divide-by-zero safely.
  • Why VAR? Readable code, and the value is calculated only once.
  • How do you do YoY %? (Sales − SAMEPERIODLASTYEAR Sales) ÷ last year's Sales, with DIVIDE.
  • Why is every RANKX rank 1? You forgot ALL around the table.

Reports, Service & Security

  • Drill-down vs drill-through? Drill-down = next level in the same visual. Drill-through = jump to a detail page.
  • What is a bookmark? A saved view of a page (filters, visible visuals), often used with buttons.
  • Table vs matrix? Table = flat list. Matrix = pivot with rows, columns and subtotals.
  • What-if vs field parameter? What-if changes a number. Field parameter changes which field or measure is shown.
  • Report vs dashboard? Report = many pages, one model, interactive. Dashboard = one page of pinned tiles from many reports, Service only.
  • What is RLS? Row-Level Security: users see only their rows. Dynamic RLS uses USERPRINCIPALNAME().
  • When do you need a gateway? When the Service must reach on-premises data.
  • How many scheduled refreshes? 8 a day on Pro, 48 a day on PPU or capacity.
  • Free vs Pro? Free can't share. Pro can share and collaborate.
  • How do you make a report faster? Performance Analyzer, remove columns, star schema, measures over calculated columns.
Remember: answer simply first, then give one small example (often with the Sales table). That beats a long textbook definition.

Learning Path

Go step by step. Build something small at each step. Install Power BI Desktop (free) first.

  1. Excel basics — sorting, filtering, pivot tables. Power BI ideas build on these.
  2. Get data + Power Query — load a CSV and an Excel file, clean them, merge and append.
  3. First report — cards, bar, line, slicers, a table. Learn interactions.
  4. Data modelling — fact and dimension tables, star schema, relationships, a date table.
  5. DAX part 1 — SUM, SUMX, COUNTROWS, DIVIDE, measures vs columns.
  6. DAX part 2 — CALCULATE, ALL, FILTER, time intelligence, RANKX, VAR.
  7. Report polish — drill-through, tooltips, bookmarks, conditional formatting, themes.
  8. Service — publish, workspaces, apps, RLS, scheduled refresh (a free Fabric trial helps).
  9. Project — build the sales dashboard from section 32 on a public dataset (e.g. a superstore sales sample). Put screenshots in your portfolio.
  10. Then — practise SQL alongside, and consider the Microsoft PL-300 (Power BI Data Analyst) certification.
Remember: for every report, ask three questions. Who will use it? What decision will they make? Which one number matters most? Build around those answers.