Complete the code to create a slicer that filters data by year.
Slicer = SELECTCOLUMNS(FILTER(Sales, Sales[Year] [1] 2020), "Year", Sales[Year])
Using '>=' allows the slicer to include all years from 2020 onwards, enabling exploration of recent data.
Complete the DAX measure to calculate total sales filtered by selected product category.
Total Sales = CALCULATE(SUM(Sales[Amount]), Sales[Category] [1] SELECTEDVALUE(Product[Category]))The '=' operator compares the sales category to the selected product category, filtering the sales correctly.
Fix the error in the DAX formula to calculate average sales per customer.
Avg Sales per Customer = DIVIDE(SUM(Sales[Amount]), DISTINCTCOUNT(Sales[1]CustomerID))In DAX, column references must be enclosed in square brackets []. Using [CustomerID] is correct syntax.
Fill both blanks to create a measure that counts sales greater than 1000 and filters by region.
High Sales Count = CALCULATE(COUNTROWS(Sales), Sales[Amount] [1] 1000, Sales[Region] [2] "West")
The '>' operator filters sales amounts greater than 1000, and '=' filters the region exactly as 'West'.
Complete the code to create a measure that calculates sales growth percentage compared to previous year.
Sales Growth % = DIVIDE(SUM(Sales[Amount]) - CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Sales[Date]))), CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Sales[Date],)) * 100 [1] "No Growth"
Closing parentheses and commas are needed to complete function calls. IFERROR handles division errors by returning 'No Growth'.