Complete the code to calculate total sales for the current year.
Total Sales Current Year = CALCULATE(SUM(Sales[Amount]), YEAR(Sales[Date]) = [1])We use YEAR(TODAY()) to get the current year for filtering sales.
Complete the code to calculate sales growth compared to the previous year.
Sales Growth = DIVIDE(SUM(Sales[Amount]) - CALCULATE(SUM(Sales[Amount]), [1](Sales[Date])), CALCULATE(SUM(Sales[Amount]), [1](Sales[Date])))
SAMEPERIODLASTYEAR returns the same period last year, which is needed to compare sales.
Fix the error in the code to calculate year-to-date sales correctly.
YTD Sales = TOTALYTD(SUM(Sales[Amount]), Sales[[1]])The TOTALYTD function requires a date column to calculate year-to-date totals.
Fill both blanks to create a measure that calculates average sales per month for the current year.
Avg Sales Per Month = DIVIDE(SUM(Sales[Amount]), CALCULATE(DISTINCTCOUNT(Sales[[1]]), YEAR(Sales[Date]) = [2]))
We count distinct months in the current year using the Month column and filter by YEAR(TODAY()).
Fill all three blanks to create a measure that calculates the percentage of sales for the current month compared to the total sales of the year.
Monthly Sales % = DIVIDE(CALCULATE(SUM(Sales[Amount]), YEAR(Sales[[3]]) = [1], MONTH(Sales[[3]]) = [2]), CALCULATE(SUM(Sales[Amount]), YEAR(Sales[[3]]) = [1])) * 100
The measure divides current month sales by total sales in the current year. We filter by YEAR(TODAY()) and use MONTH(TODAY()) to identify the current month. The date column is used for filtering.