Introduction
Understanding Filter Context in Power BI
Modifying Filter Context in Power BI
Use filter modifier functions
Examine filter context
Perform context transition
Exercise - Modify DAX filter context
PL-300 Quiz: DAX Filter Context Mastery 🎯
This quiz tests all concepts covered in the module using PL-300 exam-style questions
Section 1: Understanding Filter Context
Question 1
You have a Power BI report with a table visual showing Revenue by Region. You create the following measure:
Revenue Red = CALCULATE([Revenue], 'Product'[Color] = "Red")What happens when this measure is added to the table visual?
A) The measure shows blank values for all regions
B) The measure overwrites the existing Region filter
C) The measure adds a new filter for Red products while keeping the Region filter
D) The measure shows an error because it conflicts with the Region filter
Question 2
You have a matrix visual showing Revenue by Color (Red, Blue, Green). You apply the same measure:
Revenue Red = CALCULATE([Revenue], 'Product'[Color] = "Red")What will be the result in the matrix?
A) Only the Red row shows a value; Blue and Green show blanks
B) All rows show the same value (Red product revenue)
C) The measure shows an error
D) Each row shows its respective color revenue
Section 2: CALCULATE Function Mechanics
Question 3
Which of the following statements about the CALCULATE function is TRUE?
A) CALCULATE can only use Boolean expression filters
B) CALCULATE always adds filters without removing existing ones
C) CALCULATE can use both Boolean and table expression filters
D) CALCULATE cannot modify relationships
Question 4
You need to create a measure that shows revenue for products where the List Price is more than twice the Standard Cost. Which approach is correct?
A) CALCULATE([Revenue], 'Product'[List Price] > 'Product'[Standard Cost] * 2)
B) CALCULATE([Revenue], FILTER('Product', 'Product'[List Price] > 'Product'[Standard Cost] * 2))
C) CALCULATE([Revenue], 'Product'[List Price] = 'Product'[Standard Cost] * 2)
D) All of the above are correct
Section 3: Boolean vs Table Expression Filters
Question 5
Which of the following Boolean expression filters would cause an ERROR?
A) 'Product'[Color] = "Red"
B) 'Product'[List Price] > 1000
C) [Revenue] > 50000
D) 'Product'[Category] IN {"Bikes", "Accessories"}
Question 6
You want to create a measure that calculates revenue for products with above-average list prices. What's the correct approach?
A) CALCULATE([Revenue], 'Product'[List Price] > AVERAGE('Product'[List Price]))
B) CALCULATE([Revenue], FILTER('Product', 'Product'[List Price] > AVERAGE('Product'[List Price])))
C) CALCULATE([Revenue], 'Product'[List Price] = AVERAGE('Product'[List Price]))
D) AVERAGE('Product'[List Price]) * [Revenue]
Section 4: Filter Behavior & Modifiers
Question 7
You create this measure:
Revenue Red Keep = CALCULATE([Revenue], KEEPFILTERS('Product'[Color] = "Red"))How does this behave differently from the standard CALCULATE approach?
A) It always shows blank values
B) It preserves existing color filters and combines them with the Red filter
C) It removes all existing filters first
D) It only works with table visuals
Question 8
You need to calculate each region's percentage of total company revenue. Which measure definition is correct?
A)
Revenue % Total = [Revenue] / CALCULATE([Revenue], ALL('Sales Territory'))B)
Revenue % Total = DIVIDE([Revenue], CALCULATE([Revenue], REMOVEFILTERS('Sales Territory')))C)
Revenue % Total = [Revenue] / SUM('Sales'[Sales Amount])D) Both A and B are correct
Section 5: Examining Filter Context
Question 9
You create this measure:
Sales Commission =
[Revenue] * IF(
HASONEVALUE('Sales Territory'[Country]),
IF(VALUES('Sales Territory'[Country]) = "United States", 0.15, 0.1)
)What happens when this measure is used in a visual showing total across all countries?
A) It shows 15% commission for all countries
B) It shows 10% commission for all countries
C) It shows a blank value
D) It shows an error
Question 10
Which function would you use to test if a column is being filtered by a relationship from another table?
A) ISFILTERED()
B) ISCROSSFILTERED()
C) HASONEVALUE()
D) VALUES()
Section 6: Context Transition
Question 11
You create a calculated column:
Customer Segment =
VAR CustomerRevenue = SUM(Sales[Sales Amount])
RETURN IF(CustomerRevenue < 2500, "Low", "High")What will be the result?
A) Each customer gets the correct segment based on their individual revenue
B) All customers get "High" because SUM calculates across all customers
C) All customers get "Low"
D) The column shows an error
Question 12
To fix the previous calculated column, which approach is correct?
A)
Customer Segment =
VAR CustomerRevenue = CALCULATE(SUM(Sales[Sales Amount]))
RETURN IF(CustomerRevenue < 2500, "Low", "High")B)
Customer Segment =
VAR CustomerRevenue = [Revenue]
RETURN IF(CustomerRevenue < 2500, "Low", "High")C) Both A and B are correct
D) Neither approach will work
Section 7: Advanced Scenarios
Question 13
You need to create a measure that calculates the total for all regions using an iterator. Which approach is correct?
A)
Total Commission = SUMX(VALUES('Sales Territory'[Region]), [Revenue] * 0.1)B)
Total Commission = SUMX(VALUES('Sales Territory'[Region]),
CALCULATE([Revenue] * 0.1))C) Both approaches are equivalent
D) Neither approach will work correctly
Question 14
You want to use an inactive relationship between Date and Sales tables. Which function enables this?
A) USERELATIONSHIP()
B) CROSSFILTER()
C) ACTIVATE()
D) RELATIONSHIP()
Question 15
In a complex scenario, you need to remove filters from Region and Country columns but keep Group filters. Which approach is correct?
A) CALCULATE([Revenue], REMOVEFILTERS('Sales Territory'))
B) CALCULATE([Revenue], REMOVEFILTERS('Sales Territory'[Region], 'Sales Territory'[Country]))
C) CALCULATE([Revenue], ALL('Sales Territory'[Region], 'Sales Territory'[Country]))
D) Both B and C are correct
Final Challenge Question
Question 16
You're building a complex revenue analysis. Create a measure that shows:
- Revenue for Red or Blue products only
- But excludes any product with List Price < 100
- And shows percentage of total revenue (removing all product filters)
Which DAX formula is correct?
A)
Complex Revenue % =
DIVIDE(
CALCULATE([Revenue],
'Product'[Color] IN {"Red", "Blue"},
'Product'[List Price] >= 100
),
CALCULATE([Revenue], REMOVEFILTERS('Product'))
)B)
Complex Revenue % =
DIVIDE(
CALCULATE([Revenue],
FILTER('Product',
'Product'[Color] IN {"Red", "Blue"} &&
'Product'[List Price] >= 100
)
),
CALCULATE([Revenue], ALL('Product'))
)C) Both A and B are correct
D) Neither formula is correct
ANSWER KEY 📋
Section 1 Answers
Question 1: C
When the Color column is not already in the filter context, CALCULATE adds the new filter ('Product'[Color] = "Red") to the existing Region filter. This results in showing revenue for Red products within each region.
Question 2: B
Since the Color column is already in the filter context, CALCULATE overwrites the existing color filter with "Red" for all rows. This is why all rows show the same Red product revenue value.
Section 2 Answers
Question 3: C
CALCULATE can accept both Boolean expression filters (like 'Product'[Color] = "Red") and table expression filters (like FILTER('Product', 'Product'[ListPrice] > 1000)).
Question 4: B
Option A violates the Boolean filter rule that it can only reference one column at a time. Option B correctly uses FILTER() for multi-column comparison. Option C is incorrect logic.
Section 3 Answers
Question 5: C
Boolean expression filters cannot reference measures. [Revenue] is a measure, so this would cause an error. To use measures in filters, you must use table expressions with FILTER().
Question 6: B
Option A violates the Boolean filter rule by using an aggregate function. Option B correctly uses FILTER() to enable row-by-row comparison with the average. Options C and D don't achieve the desired logic.
Section 4 Answers
Question 7: B
KEEPFILTERS preserves existing filters instead of overwriting them. If viewing "Revenue by Color", only the Red row would show a value while others show blank, because both the existing filter and the KEEPFILTERS condition must be true.
Question 8: D
Both A and B correctly remove territory filters to calculate total revenue. REMOVEFILTERS() is the modern approach, while ALL() is the legacy method. Option C doesn't remove filters, so it would calculate incorrectly in filter context.
Section 5 Answers
Question 9: C
HASONEVALUE returns FALSE when multiple countries are in filter context (like in a total row). Since the IF condition is FALSE, the measure returns BLANK (Revenue × BLANK = BLANK).
Question 10: B
ISCROSSFILTERED() returns TRUE when a column is indirectly filtered through relationships from other tables. ISFILTERED() only detects direct filters on the column itself.
Section 6 Answers
Question 11: B
In a calculated column, SUM operates without filter context, so it sums ALL sales amounts in the table for every customer. Since this total is likely > 2500, all customers get "High". Context transition with CALCULATE() is needed.
Question 12: C
Both approaches achieve context transition. Option A explicitly uses CALCULATE() to transition row context to filter context. Option B references a measure, which automatically performs context transition.
Section 7 Answers
Question 13: C
Both are equivalent because [Revenue] is a measure. In iterator functions, measures automatically perform context transition. Option B explicitly shows the CALCULATE, but it's not necessary when referencing measures.
Question 14: A
USERELATIONSHIP() is specifically designed to activate inactive relationships within CALCULATE(). CROSSFILTER() modifies relationship behavior but doesn't activate inactive relationships.
Question 15: D
Both B and C correctly remove filters from specific columns while preserving filters on other columns. REMOVEFILTERS() is the modern approach, ALL() is legacy but still works.
Final Challenge Answer
Question 16: C
Both formulas correctly implement the requirements:
- A uses Boolean filters (valid since each condition references one column)
- B uses a table filter with FILTER() for multiple conditions
- Both correctly remove product filters in the denominator for percentage calculation
- REMOVEFILTERS() and ALL() achieve the same result in this context
Quiz Summary & Scoring 📊
Score Interpretation:
- 14-16 correct: 🏆 Expert Level - Ready for PL-300 DAX questions
- 11-13 correct: ⭐ Advanced - Strong understanding, review complex scenarios
- 8-10 correct: 📚 Intermediate - Good foundation, practice filter context scenarios
- Below 8: 🔄 Review Needed - Revisit the module content and practice more
Key Topics to Master:
- Filter Context Behavior - Understanding when CALCULATE adds vs overwrites filters
- Boolean vs Table Filters - Knowing when to use each approach and their limitations
- Filter Modifiers - REMOVEFILTERS, KEEPFILTERS, ALL, ALLEXCEPT usage
- Context Transition - Row context to filter context conversion
- Filter Examination - VALUES, HASONEVALUE, SELECTEDVALUE functions
- Advanced Scenarios - Inactive relationships, iterator functions, complex filtering
📝 Practice Recommendations:
- Work with Adventure Works sample data to test these scenarios
- Practice creating measures with different filter contexts
- Experiment with visuals to see how filter context changes
- Build complex percentage calculations using REMOVEFILTERS
- Create calculated columns with proper context transition