By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Evaluation context in Power BI determines how DAX formulas calculate results. It’s the invisible engine that decides whether a measure sums all rows, filters by a slicer, or respects a row-level condition.
Why it matters in production:- Broken reports: If you don’t understand evaluation context, your measures will return wrong numbers—silently. A sales dashboard might show "Total Revenue = $1M" when it should be "$500K" because a filter wasn’t applied.- Performance nightmares: Misusing context can force Power BI to scan entire tables instead of using optimized filters, turning a 2-second refresh into a 2-minute crawl.- Debugging hell: When a measure "suddenly" stops working after adding a slicer, 90% of the time it’s an evaluation context issue.
Real-world scenario:You inherit a Power BI report from a colleague. The "Average Order Value" measure works fine in a table visual but returns the same number in a card visual—no matter what filters you apply. The problem? The measure ignores filter context because it was written with CALCULATE incorrectly.
CALCULATE
FILTER
SUM(Sales[Amount])
Sales
dax // Calculated column (row context exists) Sales[Tax] = Sales[Amount] * 0.08
Sales[Amount]
Sales[Year] = 2023
dax // Measure (filter context exists) Total Sales = SUM(Sales[Amount])
Year = 2023
dax Sales 2023 = CALCULATE(SUM(Sales[Amount]), Sales[Year] = 2023)
CALCULATE(SUM(Sales[Amount]), Sales[Region] = "West")
Sales[Region] = "West"
dax // Context transition in action West Sales = CALCULATE(SUM(Sales[Amount]), Sales[Region] = "West")
ALL
dax // Total sales, ignoring all filters Total Sales All Years = CALCULATE(SUM(Sales[Amount]), ALL(Sales[Year]))
// Faster: Direct filter in CALCULATE High Value Sales = CALCULATE(SUM(Sales[Amount]), Sales[Amount] > 1000) ```
EARLIER
dax // Calculated column: Compare current row to previous row Sales[Prev Amount] = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, Sales[ID] = EARLIER(Sales[ID]) - 1))
HASONEVALUE
dax // Show product name only if one product is selected Selected Product = IF(HASONEVALUE(Products[Name]), VALUES(Products[Name]), "Multiple Products")
Amount
Year
Region
Products
ProductID
Name
You’re given a measure that always shows total sales, even when a slicer filters by Year or Region.
Total Sales
dax Total Sales = CALCULATE(SUM(Sales[Amount]), ALL(Sales))
ALL(Sales)
Replace the measure with:
Total Sales = SUM(Sales[Amount])
Now the measure will respect slicers.
2023
If you also want a measure that ignores slicers (e.g., for comparisons), create a new measure:
Total Sales All Years = CALCULATE(SUM(Sales[Amount]), ALL(Sales[Year]))
Now you can use both measures in the same visual.
REMOVEFILTERS
CALCULATE(SUM(...), Table[Column] = "Value")
KEEPFILTERS
CALCULATE(..., KEEPFILTERS(...))
ALL_
ALL_Total Sales
dax // Respects all filters except Year Total Sales = CALCULATE(SUM(Sales[Amount]), REMOVEFILTERS(Sales[Year]))
SELECTEDVALUE
dax Debug Year = SELECTEDVALUE(Sales[Year], "No Year Selected")
ISFILTERED
dax Is Year Filtered = ISFILTERED(Sales[Year])
SUM
CALCULATE(SUM(...))
Answer: Filter context (from visuals, slicers, and relationships).
CALCULATE behavior:
CALCULATE(SUM(Sales[Amount]), ALL(Sales[Year]))
Answer: Sums Amount while ignoring any filters on Year.
Row vs filter context:
Answer: The sum of all rows in Sales[Amount] (row context doesn’t apply to measures).
EARLIER usage:
REMOVEFILTERS(Sales[Year])
"You have a measure Total Sales = SUM(Sales[Amount]). When you add a slicer for Year, the measure still shows the grand total. What’s the most likely cause?" - Answer: The measure is wrapped in CALCULATE(..., ALL(Sales)) or ALL(Sales[Year]).
CALCULATE(..., ALL(Sales))
ALL(Sales[Year])
Create a measure that shows: - The total sales for the current year (respecting slicers).- The total sales for all years (ignoring slicers).- The difference between the two.
// Current year sales (respects slicers) Current Year Sales = SUM(Sales[Amount]) // All years sales (ignores slicers) All Years Sales = CALCULATE(SUM(Sales[Amount]), ALL(Sales[Year])) // Difference Sales Difference = [Current Year Sales] - [All Years Sales]
Why it works:- Current Year Sales respects filter context (e.g., slicers).- All Years Sales uses ALL(Sales[Year]) to ignore year filters.- The difference measure dynamically updates based on slicer selections.
Current Year Sales
All Years Sales
TRUE
FALSE
Final Tip:When in doubt, test your measures in a table visual with different slicers. If the numbers don’t change as expected, you’ve got an evaluation context issue. Use SELECTEDVALUE and ISFILTERED to debug.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.