Challenge - 5 Problems
CALCULATE Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ dax_lod_result
intermediate2:00remaining
Calculate Total Sales for a Specific Year
Given a Sales table with columns [SalesAmount] and [Year], what is the result of this DAX measure?
If the Sales table has these rows:
- Year: 2018, SalesAmount: 100
- Year: 2019, SalesAmount: 200
- Year: 2019, SalesAmount: 300
- Year: 2020, SalesAmount: 400
What is the value of
TotalSales2019 = CALCULATE(SUM(Sales[SalesAmount]), Sales[Year] = 2019)If the Sales table has these rows:
- Year: 2018, SalesAmount: 100
- Year: 2019, SalesAmount: 200
- Year: 2019, SalesAmount: 300
- Year: 2020, SalesAmount: 400
What is the value of
TotalSales2019?Power BI
TotalSales2019 = CALCULATE(SUM(Sales[SalesAmount]), Sales[Year] = 2019)Attempts:
2 left
💡 Hint
Think about filtering only the rows where Year is 2019 before summing.
✗ Incorrect
CALCULATE changes the filter context to only include rows where Year equals 2019. Then it sums SalesAmount for those rows: 200 + 300 = 500.
❓ visualization
intermediate2:00remaining
Visualizing Sales with CALCULATE Filter
You want to create a bar chart showing total sales only for the year 2020 using a measure with CALCULATE.
Which of these DAX measures will correctly show total sales for 2020 in the bar chart?
Which of these DAX measures will correctly show total sales for 2020 in the bar chart?
Attempts:
2 left
💡 Hint
Remember CALCULATE changes the filter context to what you specify.
✗ Incorrect
Option B filters Sales to Year = 2020 and sums SalesAmount. Option B is invalid syntax. Option B filters out 2020, so it excludes those sales. Option B removes all Year filters, showing total sales for all years.
🧠 Conceptual
advanced1:30remaining
Understanding CALCULATE Filter Context Modification
Which statement best describes what the CALCULATE function does in DAX?
Attempts:
2 left
💡 Hint
Think about how CALCULATE affects what data is included in a measure.
✗ Incorrect
CALCULATE modifies the filter context by applying the filters you specify, then evaluates the expression in that new context.
🔧 Formula Fix
advanced1:30remaining
Identify the Error in CALCULATE Usage
What error will this DAX measure cause?
Measure = CALCULATE(SUM(Sales[Amount]), Sales[Year] == 2021)Power BI
Measure = CALCULATE(SUM(Sales[Amount]), Sales[Year] == 2021)Attempts:
2 left
💡 Hint
Check the filter condition syntax inside CALCULATE.
✗ Incorrect
DAX uses a single equals sign (=) for filter conditions. Using double equals (==) causes a syntax error.
🎯 Scenario
expert2:30remaining
Using CALCULATE to Override Existing Filters
You have a report page filtered to Year = 2022. You want a measure that shows total sales for Year = 2021 regardless of the page filter.
Which DAX measure achieves this?
Which DAX measure achieves this?
Attempts:
2 left
💡 Hint
Think about how to ignore existing filters on Year before applying your own filter.
✗ Incorrect
Option D removes all filters on Sales[Year] first, then applies the filter Year = 2021, ignoring the page filter Year = 2022. Option D applies the filter but does not remove existing filters, so the page filter still applies. Option D ignores filtering. Option D removes filters but does not reapply the Year = 2021 filter.