INTERVIEWKIT PRACTICE GUIDE

DAX interview questions: CALCULATE, context and measures

By InterviewKit · Updated · 9 practice questions

Explain what a measure should return before writing DAX. These original examples assume a Sales fact table related to Product and Date dimensions. Test every measure at detail and total levels.

1–3 years: measures and context

1. How does a measure differ from a calculated column?

A calculated column holds a value for each row. In an Import model, its values are calculated during refresh and stored. A measure is evaluated for the current query context, so report filters can change the result. Choose based on the required behaviour and model cost.

2. What is filter context?

It is the set of filters that applies when an expression is evaluated. Slicers, visual rows, filters and relationships can affect it. A sales measure can therefore show a different value for each selected year or product.

3. When does SELECTEDVALUE return its alternate result?

It returns the alternate result when the current context contains zero or more than one distinct value. A single distinct value returns that value. Use a clear fallback for report labels.

Selected category =
SELECTEDVALUE(Product[Category], "Choose one category")

4–7 years: CALCULATE and practical calculations

4. What does CALCULATE change?

It evaluates an expression after changing filter context. A filter argument can add a filter or replace a filter already on the same column. KEEPFILTERS changes that interaction to an intersection.

5. When do you use SUMX instead of SUM?

SUM adds the values in one column. SUMX evaluates an expression for each row of a table and then adds those results. For line revenue, multiply quantity by unit price on each row.

Line revenue =
SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])

6. How would you calculate sales as a share of all product categories?

Keep the numerator in its current context and remove only the category filter from the denominator. Other filters, such as the selected date, remain. Removing the entire Product table would answer a different question.

Category share =
DIVIDE(
  [Total sales],
  CALCULATE([Total sales], REMOVEFILTERS(Product[Category]))
)

7+ years: evaluation and debugging

7. What is context transition?

CALCULATE can turn an existing row context into filter context. This matters inside iterators and calculated columns. A model measure used in row context gets this transition automatically, so a measure reference and a bare aggregation can behave differently.

8. Why can a total differ from the sum of the displayed rows?

The total evaluates the measure in the total’s filter context. It does not always add the rendered cells. Ratios, distinct counts and conditional measures often behave this way. Establish the business rule before adding an iterator to force a sum.

9. How would you investigate a slow DAX measure?

Reproduce the slow visual with the same filters. Use Performance Analyzer and inspect the query and model. Check relationship design, high-cardinality columns and unnecessary iteration over large tables. Change one part, verify the result and compare timings.

Worked example: preserve an existing category selection

Assume Total sales is a measure. This calculation returns sales for Accessories only when that category is also allowed by the current filters.

Accessories sales =
CALCULATE(
  [Total sales],
  KEEPFILTERS(Product[Category] = "Accessories")
)

Without KEEPFILTERS, this filter normally replaces an existing filter on Product[Category]. With it, the filter intersects the existing selection. Test with Accessories selected, another category selected and no category selected.

How to use this guide

Attempt each question before reading its answer. Explain your assumptions, show a small example and test an edge case. Use the experience bands as a guide to depth, rather than a promise about what an employer will ask.

These are independently written practice questions, not verified questions from particular employers. Free guide answers do not change the contents of the paid PDFs.

Compare available interview PDFs
KEEP YOUR REVISION ORGANISED

Ready for a focused DAX question bank?

Choose a PDF edition for deeper, topic-by-topic practice. Compare its sample questions, experience level, answer coverage and current price before buying.

View DAX PDF options

One-time purchase. SQL PDFs include model answers; DAX and Power BI Service PDFs contain questions only.

Further reading

Check the official documentation when you need exact behaviour or current platform requirements.

Continue your preparation

All free interview guides · Power BI preparation · SQL PDFs · DAX PDFs