0
0
Power BIbi_tool~20 mins

Filter context concept in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Filter Context Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Filter Context in DAX Measures

In Power BI, what does the filter context affect when calculating a measure?

AIt changes the data type of the columns used in the measure.
BIt determines which rows of data are included in the calculation of the measure.
CIt modifies the visual layout of the report page.
DIt controls the refresh frequency of the dataset.
Attempts:
2 left
💡 Hint

Think about how filters affect what data is used in calculations.

dax_lod_result
intermediate
2:00remaining
Result of a Measure with Filter Context

Given the Sales table with columns: Product, Region, and SalesAmount, and the measure:

Total Sales = SUM(Sales[SalesAmount])

If a report visual filters Region to 'West', what is the output of Total Sales?

ASum of SalesAmount only for the 'West' region.
BAverage SalesAmount for all regions.
CCount of rows in Sales table.
DSum of SalesAmount for all regions.
Attempts:
2 left
💡 Hint

Filter context limits data to the selected region.

🔧 Formula Fix
advanced
2:00remaining
Why Does This Measure Ignore Report Filters?

Consider this DAX measure:

All Sales = CALCULATE(SUM(Sales[SalesAmount]), ALL(Sales))

Why does this measure show the total sales ignoring any report filters?

ABecause CALCULATE disables all filters by default.
BBecause SUM ignores filters applied in visuals.
CBecause the measure is not connected to the data model.
DBecause the ALL function removes all filters from the Sales table, ignoring filter context.
Attempts:
2 left
💡 Hint

Think about what the ALL function does to filters.

visualization
advanced
2:00remaining
Best Visualization to Show Filter Context Impact

You want to show how sales differ by Region and Product Category, reflecting filter context changes dynamically. Which visualization type best supports this?

AMatrix visual with Region as rows and Product Category as columns showing sales measures.
BCard visual showing overall total sales only.
CPie chart showing total sales without any breakdown.
DText box with static sales description.
Attempts:
2 left
💡 Hint

Choose a visual that can show multiple categories and respond to filters.

🎯 Scenario
expert
3:00remaining
Calculating Sales Growth Ignoring Certain Filters

You want to create a measure that calculates sales growth compared to the previous year but ignores any filters on Product Category while respecting other filters like Region and Date. Which DAX expression achieves this?

ASales Growth = CALCULATE(SUM(Sales[SalesAmount]), FILTER(ALL(Sales), Sales[Product Category] = EARLIER(Sales[Product Category]))) - SUM(Sales[SalesAmount])
BSales Growth = SUM(Sales[SalesAmount]) - CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSYEAR(Date[Date]))
CSales Growth = CALCULATE(SUM(Sales[SalesAmount]), SAMEPERIODLASTYEAR(Date[Date]), ALL(Sales[Product Category])) - SUM(Sales[SalesAmount])
DSales Growth = CALCULATE(SUM(Sales[SalesAmount]), ALL(Sales)) - SUM(Sales[SalesAmount])
Attempts:
2 left
💡 Hint

Use ALL to remove filters on Product Category only.