DAX CALCULATE interview questions with filter-context examples
By InterviewKit · Updated · 9 practice questions
A useful DAX answer explains which filters apply and what the result means. Assume a Product dimension with one row per product and an active one-to-many relationship to Sales. Product filters flow to Sales. The examples below are original learning scenarios.
1–3 years: explain the filter first
1. What does CALCULATE do?
It evaluates an expression in modified filter context. Begin with the expression, identify the incoming filters, then explain what each filter argument adds or replaces. This is more useful in an interview than describing it only as an advanced function.
2. How do you define a basic sales measure?
When Sales[Amount] already stores the line amount, SUM is enough. Do not multiply it again by quantity. Confirm the meaning and grain of the column before choosing the calculation.
Total sales = SUM(Sales[Amount])3. What happens to a date selection when you filter only Product[Category]?
A filter argument that targets the category column does not directly remove a filter on the Date table. In this model, the calculation remains subject to the date selection. Always consider relationship paths and any other filter modifiers in the measure.
4–7 years: replacement versus intersection
4. Why can a category measure show Accessories sales when Bikes is selected?
A normal filter argument on Product[Category] replaces an existing filter on that same column. A different product selection, such as a filter on Product[ProductName], may still constrain the result. Check the exact columns used by the slicer.
5. When should you use KEEPFILTERS?
Use it when the new condition must intersect the existing selection. In the worked example, Accessories and Bikes have no overlap. The intersection therefore has no matching sales rows. This choice expresses a business rule; neither version is universally correct.
6. How do you calculate a category share while keeping the selected date?
Remove the category filter from the denominator, rather than clearing every filter in the model. DIVIDE handles a zero or blank denominator without a division error. This removes only the named category filter; other product filters can still apply.
Category share =
DIVIDE(
[Total sales],
CALCULATE([Total sales], REMOVEFILTERS(Product[Category]))
)7+ years: transition and debugging
7. Can CALCULATE matter without a filter argument?
Yes. With an existing row context, it can perform context transition into filter context. A model measure invoked in row context gets that transition automatically. Be explicit about whether the expression is a measure reference or a bare aggregation.
8. Why is the grand total not always the sum of visible row values?
The measure runs again in the total filter context. A ratio or distinct count can legitimately produce a different result from adding displayed cells. First define the business meaning of the total, then decide whether iterating over categories is appropriate.
9. How would you debug an incorrect CALCULATE result?
Make a small case with known totals. Test the base measure, each filter argument separately, no selection, one selection, multiple selections and the total row. Inspect relationship direction and active relationships. Verify correctness before comparing performance of alternative formulas.
Worked example: the same category filter, two business meanings
The Product dimension filters Sales by ProductKey. The two sales rows are Accessories = 120 and Bikes = 80. There are no other filters. Compare these measures against a slicer using Product[Category].
| Product[Category] | Sales[Amount] |
|---|---|
| Accessories | 120 |
| Bikes | 80 |
Accessories override =
CALCULATE([Total sales], Product[Category] = "Accessories")
Accessories within selection =
CALCULATE(
[Total sales],
KEEPFILTERS(Product[Category] = "Accessories")
)| Selection | Override | Within selection |
|---|---|---|
| No selection | 120 | 120 |
| Accessories | 120 | 120 |
| Bikes | 120 | BLANK |
| Accessories + Bikes | 120 | 120 |
SUM returns BLANK when the intersection has no matching rows. Convert that to zero only if the report requires it. These expected results assume the slicer uses the exact category column in the measures, not a disconnected table or a product-name column. Follow-up: which result should your report show when the user selects Bikes?
Related practice guides
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 PDFsReady for a focused DAX CALCULATE 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 CALCULATE PDF optionsOne-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