skip to content

Power BI

Microsoft's stack from ingestion to sharing: Power Query for shaping, a star-schema model, DAX measures, report visuals, and the Service for distribution. Interviewers ask about it as a whole, because each layer's mistakes surface in the next one.

on this pageshow

explore

questions

page 1 of 2

In Power BI, when should a calculation be a calculated column instead of a DAX measure?

level: juniorimportance: must knowfreq 85%

answer

  1. one is stored, one is not
  2. ask when the value gets computed
  3. slicers need values that already exist
  4. refresh time versus query time
  5. a stored percentage cannot be summed

basics

~20 s

Use a calculated column when the value must physically exist per row — for slicers, axes, grouping or relationship keys. Use a measure for anything aggregated, because measures are computed at query time and store nothing in the model.

solid answer

~50 s

A **calculated column** is evaluated once per row when the model refreshes and is stored in the table, so it costs memory and refresh time but can be used anywhere a real column can: on a slicer, on an axis, as a grouping field, or as a relationship key. A **measure** is not stored at all — it is evaluated at query time against whatever the visual is filtering, so it re-computes correctly at every level, including totals. The rule of thumb: if the value describes a row (a price band, a flag, a concatenated key), it is a column; if it aggregates rows (sales, margin %, distinct customers), it is a measure. Writing `Margin % = SUM(Sales[Profit]) / SUM(Sales[Revenue])` as a column is the classic mistake — a stored per-row ratio cannot be summed back up. Where possible, push column logic upstream into Power Query or the source rather than materialising it in DAX.

code

dax · 7 lines
dax
-- calculated column: one stored value per product row
Product[Price Band] =
    IF ( Product[ListPrice] > 100, "High", "Low" )

-- measure: no stored value, re-evaluated per visual cell
Margin % =
    DIVIDE ( SUM ( Sales[Profit] ), SUM ( Sales[Revenue] ) )

go deeper

for a junior

Be ready to state the rule cleanly: per-row value that users slice by means a column, aggregation means a measure. Know that a calculated column is stored and a measure is not.

for a middle

Explain the mechanics: calculated columns evaluate in row context at refresh and are compressed into VertiPaq; measures evaluate at query time under the visual's filters, which is why they give correct totals.

for a senior

Show the cost judgment. Talk about column cardinality driving model size, pushing column logic upstream to Power Query or the source, and auditing a bloated model for calculated columns that duplicate dimension attributes.

for a principal

Own the standard: where calculation logic lives across the stack, so the same business rule is not implemented three times in SQL, in M and in DAX, and so self-service authors are not materialising fact-table attributes that a star schema already provides.

## Two different objects that both use DAX A Power BI model (the semantic model, called a *dataset* before the Fabric-era rename) holds its tables in VertiPaq, an in-memory columnar engine. DAX can add two very different things to that model, and confusing them is the single most common beginner error in Power BI modelling. A **calculated column** adds a new column to an existing table. It is evaluated **row by row, once, at data-refresh time**, and the result is compressed and stored alongside every other column in the table. It has *row context*: inside the formula, a bare column reference means "this row's value", and `RELATED` can reach across a relationship to fetch the matching row on the one side. A **measure** adds a calculation to the model that has **no stored value at all**. It is evaluated **at query time**, once per cell the visual asks for, against the set of filters that cell is under. A measure has no row context of its own — it must aggregate (`SUM`, `COUNTROWS`, `SUMX`, …), which is why a measure body that references a bare column without an aggregator is an error. ## What that difference implies **Where you can use it.** A slicer, a chart axis, a matrix row header, a legend, a `Group by` field, and the key of a relationship all require *a column* — a real set of values that exists before any query runs. A measure cannot fill any of those roles; it only ever produces a value inside a cell. So if the requirement is "let users slice by price band", the price band must be a calculated column (or, better, a column created upstream). **Cost.** A calculated column consumes model memory and lengthens refresh. The cost is driven by *cardinality*: a low-cardinality column such as a three-value price band compresses to almost nothing, while a per-row calculated key or a per-row timestamp calculation can be one of the largest columns in the model. Calculated columns are also computed after the table is loaded, so they can compress worse than an equivalent column imported from the source. Measures cost nothing at rest; they cost CPU at query time. **Correctness at totals.** This is the deciding argument for ratios. If `Margin %` is stored per row, a matrix total can only aggregate those stored numbers — summing percentages is meaningless, and averaging them weights a one-dollar order the same as a million-dollar order. As a measure, `DIVIDE(SUM(Sales[Profit]), SUM(Sales[Revenue]))` re-evaluates at every grain, including the total row, and produces the correct weighted figure everywhere. ## The upstream option A third answer beats both in many interviews: do it in **Power Query** or in the source view. A column produced upstream is materialised the same way as any imported column, often compresses better, keeps DAX in the model simple, and (when the source is a database) can fold into SQL. Reserve calculated columns for logic that genuinely depends on the model — for example a value that needs `RELATED` across a relationship that only exists in Power BI, or a column derived from another calculated column. ## Worked contrast Given a `Sales` table with `Revenue` and `Profit`, and a `Product` table joined one-to-many to it: - `Product[Price Band] = IF(Product[ListPrice] > 100, "High", "Low")` — a calculated column. It is an attribute of a product, it has three possible values, it belongs on a slicer. - `Sales[Product Category] = RELATED(Product[Category])` — a calculated column that *works* but is usually a waste: the relationship already lets any visual group `Sales` measures by `Product[Category]`. Copying the attribute onto the fact table just spends memory and defeats the star schema. - `Total Profit = SUM(Sales[Profit])` and `Margin % = DIVIDE([Total Profit], SUM(Sales[Revenue]))` — measures. They must respond to whatever the user filtered. ## What interviewers listen for A strong answer names three axes — *when it is evaluated*, *whether it is stored*, and *where it can be used* — and then states the ratio-at-totals failure as the concrete consequence. A weaker answer describes them as two syntaxes for the same thing, or reaches for a calculated column first because it feels more like a spreadsheet. Mentioning that most calculated columns should have been created upstream is what separates a modeller from someone who only writes formulas.

  • Why can't you fix a wrong total by writing the ratio as a calculated column?
    Because a stored per-row ratio is just a number in a column, and the total row can only aggregate those numbers. Summing percentages is meaningless and averaging them weights every row equally. The correct total needs the ratio recomputed from summed numerator and denominator at the total grain, which only a query-time measure does.
  • When is a calculated column the wrong choice even though the value is per-row?
    When the source or Power Query can produce it. An upstream column usually compresses better, refreshes faster, keeps model DAX small, and can fold to SQL against a database. Reserve DAX calculated columns for logic that depends on the model itself, such as a value fetched with RELATED across a relationship that exists only in Power BI.
  • What does high cardinality do to the cost of a calculated column?
    VertiPaq compresses columns by their distinct values, so a three-value flag is nearly free while a per-row key, timestamp or computed decimal can become one of the largest objects in the model. Before adding a high-cardinality calculated column, check whether a measure or an upstream, lower-cardinality column would do.

A calculated column is like adding a column to a spreadsheet and filling it down once; a measure is like a formula in a summary cell that recalculates for whatever range you are currently looking at.

saying these in an interview costs you the question

  • Treats calculated columns and measures as interchangeable syntax
  • Stores a ratio like margin percent as a calculated column
  • Ignores memory and refresh cost of high-cardinality calculated columns
  • Thinks a measure can be dropped onto a slicer
  • Never considers building the column upstream in Power Query

context

open as a page

In Power Query, how does Merge Queries differ from Append Queries?

level: juniorimportance: must knowfreq 70%

basics

~20 s

Merge Queries joins two Power Query queries side by side on matching key columns, producing a wider table. Append Queries stacks their rows, producing a taller table. Merge is a SQL-style join; Append behaves like UNION ALL.

open as a page

In a Power BI report, what happens to other visuals when you click a bar in one chart?

level: juniorimportance: must knowfreq 72%

basics

~20 s

By default the clicked point cross-highlights the page: other charts keep their full bars but shade the selected share, while tables, matrices and cards are filtered outright. Edit interactions sets each target visual to Filter, Highlight or None.

open as a page

When you publish a Power BI Desktop file to a workspace, what items appear in the Service?

level: juniorimportance: must knowfreq 70%

basics

~10 s

Publishing a .pbix creates two workspace items: the report (pages and visuals) and the semantic model (queries, relationships, DAX and imported data). A file that live-connects to an existing model publishes the report only.

open as a page

In Power BI, what do a relationship's cardinality and cross-filter direction control?

level: middleimportance: must knowfreq 75%

basics

~20 s

Cardinality declares which side of the relationship holds unique key values; cross-filter direction declares which way a filter travels along it. A one-to-many relationship filters from the one side down to the many side, and by default not back.

open as a page

In DAX, how does a CALCULATE filter argument combine with the visual's existing filters?

level: middleimportance: must knowfreq 80%

basics

~20 s

A boolean filter argument in CALCULATE replaces any existing filter on the same column rather than intersecting with it, while leaving filters on other columns intact. Wrap it in KEEPFILTERS to intersect instead of overwrite.

open as a page

In DAX, what is the difference between row context and filter context?

level: middleimportance: must knowfreq 85%

basics

~20 s

Filter context is the set of filters restricting which model rows a DAX expression sees; it comes from visuals, slicers and CALCULATE. Row context is a pointer to one current row inside a calculated column or an iterator, and it does not filter anything by itself.

open as a page

In Power Query, what is query folding and which steps typically break it?

level: middleimportance: must knowfreq 80%

basics

~20 s

Query folding is Power Query translating Applied Steps into a single native query the source executes, so filtering and aggregation happen at the source. Steps M cannot translate — an index column, Table.Buffer, cross-source merges — end folding, and everything after runs locally.

open as a page

In Power BI, what filters a drill-through page when a reader right-clicks a data point?

level: middleimportance: must knowfreq 60%

basics

~20 s

The values of the fields placed in the target page's drill-through well, taken from the clicked data point. With Keep all filters on, the source visual's other filters travel too, so the detail page matches the context the reader came from.

open as a page

In Power BI, how does dynamic RLS use USERPRINCIPALNAME() to filter rows per user?

level: middleimportance: must knowfreq 68%

basics

~20 s

One role filters a user-mapping table with [UserEmail] = USERPRINCIPALNAME(), which returns the signed-in user's UPN. That row set propagates through relationships to the dimensions and facts, so a single role serves every user and permissions become refreshable data.

open as a page

In Power BI, what does a row-level security role do to the data a report user sees?

level: middleimportance: must knowfreq 75%

basics

~20 s

A Power BI role holds a DAX boolean filter on one or more tables. The engine applies it to every query the assigned user runs and propagates it along relationships, so excluded rows never reach visuals, totals or exports.

open as a page

When does a Power BI scheduled refresh require an on-premises data gateway?

level: middleimportance: must knowfreq 72%

basics

~20 s

A gateway is needed whenever the Power BI Service cannot reach the source directly — anything on-premises or inside a private network. Cloud sources reachable over the public internet refresh without one. DirectQuery and live connections to on-prem sources need the standard gateway.

open as a page

In DAX, what does DIVIDE do that the / operator does not?

level: juniorimportance: should knowfreq 55%

basics

~20 s

DIVIDE is DAX's safe division function: when the denominator is zero or blank it returns BLANK, or an alternate result you pass as the third argument. The / operator instead yields Infinity or NaN, which then leaks into the visual.

open as a page

In Power BI Desktop, how do you check what an RLS role sees before publishing?

level: juniorimportance: should knowfreq 42%

basics

~20 s

Use Desktop's View as feature to render the report under a chosen role, and for dynamic RLS also as another user by typing their UPN. After publishing, the semantic model's security page in the Power BI Service can test the report as a role.

open as a page

In Power BI, why does a matrix show a (Blank) row for a dimension attribute?

level: middleimportance: should knowfreq 50%

basics

~20 s

Power BI adds a hidden blank row to the one side of a relationship when the fact table contains key values that have no match, or nulls. Those fact rows are grouped under (Blank) so the total still includes them.

open as a page

In DAX, why is SUMX(Sales, Sales[Qty] * Sales[Price]) not SUM(Sales[Qty]) * SUM(Sales[Price])?

level: middleimportance: should knowfreq 65%

basics

~20 s

SUMX multiplies quantity by price inside each row and then adds the results, so every row uses its own price. Multiplying two SUMs multiplies a total quantity by a total price, which is a number no transaction ever had.

open as a page

In Power Query, how do you turn a parameterized query into a reusable M function?

level: middleimportance: should knowfreq 42%

basics

~20 s

Wrap the query's let expression in an M lambda — (p as text) as table => let … in … — or use Create Function on a query driven by parameters. Invoking it per row adds a table column you expand, and each row is a separate source call.

open as a page

In Power Query, what happens when a Changed Type step hits an unconvertible value?

level: middleimportance: should knowfreq 55%

basics

~20 s

That single cell becomes an Error value rather than failing the query; surrounding rows load normally. A step-level failure is different — a missing or renamed column aborts the whole query. Handle cell errors explicitly with try/otherwise, Replace Errors or Remove Errors.

open as a page

In Power BI, what report state does a bookmark capture when you save it?

level: middleimportance: should knowfreq 45%

basics

~20 s

A Power BI bookmark saves the page's current state — filter and slicer selections, cross-highlight selection, sort order, drill level, and which visuals are shown or hidden — so a button can restore it. It stores no data; visuals re-query the model when applied.

open as a page

In Power BI, when should you distribute content as an app rather than sharing reports directly?

level: middleimportance: should knowfreq 58%

basics

~20 s

Use a Power BI app once an audience is larger than a handful or the content is finished: it packages chosen workspace items into a stable read-only experience with its own audiences. Direct share links suit ad-hoc, one-off access and sprawl badly at scale.

open as a page

In Power BI, what goes wrong when you set a relationship's cross-filter direction to Both?

level: seniorimportance: should knowfreq 65%

basics

~20 s

Bidirectional filtering lets filters travel back up from the fact table, which can create more than one route between tables, make results depend on the path taken, slow queries, and interact badly with row-level security. Scope it per measure instead.

open as a page

In Power BI, when should you use a bridge table instead of a many-to-many cardinality relationship?

level: seniorimportance: should knowfreq 55%

basics

~20 s

Use a bridge table whenever you need strong relationships, a slicer over the shared keys, or reliable totals. Power BI's many-to-many cardinality creates a limited relationship: no blank row for unmatched keys, no RELATED, and totals that can stop matching the visible rows.

open as a page

In DAX, why does SAMEPERIODLASTYEAR return blank or wrong values without a proper date table?

level: seniorimportance: should knowfreq 50%

basics

~20 s

DAX time-intelligence functions shift a set of dates and reapply it as a filter, which requires a dedicated date table with one row per contiguous calendar day, related to the fact table and marked as a date table. Gaps, duplicates, or filtering the fact table's own date column break the shift.

open as a page

In a Power BI matrix, why doesn't a DAX measure's total row equal the sum of the rows?

level: seniorimportance: should knowfreq 60%

basics

~20 s

The total is not a sum of the displayed cells. Power BI evaluates the same DAX measure again in the total's filter context, with the row grouping removed, so any non-additive measure — a ratio, a distinct count, a conditional — legitimately returns something else.

open as a page

A Power BI report page takes 30 seconds to render — how do you find which visual is responsible?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Run Performance Analyzer in Power BI Desktop: it records each visual's time split into DAX query, visual display and other, so you can see which visual dominates and whether the cost is the model query or the rendering. Fix that one rather than guessing.

open as a page

A Power BI RLS role filters DimRegion, yet the fact table still shows every row — why?

level: seniorimportance: should knowfreq 48%

basics

~20 s

The security filter only travels where model relationships carry it. Look for a missing, inactive or wrongly directed relationship, a fact table joined to a different dimension copy, or a disconnected table — and confirm the user is not exempt through workspace edit rights.

open as a page

In the Power BI Service, which users bypass RLS on a semantic model, and why?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Users with workspace Admin, Member or Contributor roles hold edit permission on the semantic model, and RLS is not applied to them. Roles restrict read-only consumers — Viewers and app audiences — and a read-only user assigned to no role sees no data.

open as a page

A Power BI refresh reports success but the dashboard still shows yesterday's numbers — how do you diagnose it?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Check what actually refreshed and when the source was ready. Common causes: you refreshed a different semantic model, incremental refresh touched only recent partitions, the upstream load finished after the schedule fired, or a cached dashboard tile lags the report.

open as a page

When should transformation logic live in Power Query rather than upstream SQL or DAX?

level: principalimportance: should knowfreq 33%

basics

~20 s

Keep in Power Query only shaping that is local to one model or reachable only through a connector — folders of files, APIs, unpivoting. Shared, expensive or auditable logic belongs upstream in the warehouse; logic that must react to user filters belongs in DAX.

open as a page

How would you structure Power BI workspaces and promotion for a shared semantic model used by many teams?

level: principalimportance: should knowfreq 38%

basics

~20 s

Separate the governed semantic model into its own workspace with tight write access and Build permission for analysts, keep team reports in their own workspaces live-connected to it, promote changes through dev/test/prod stages, and endorse the model so people find the right one.

open as a page

showing 1–30 of 36