Complete the code to declare a variable named TotalSales that sums the Sales column.
VAR TotalSales = SUM(Sales[[1]]) RETURN TotalSalesThe variable TotalSales is set to the sum of the Sales column. Using SUM(Sales[Sales]) correctly sums the Sales values.
Complete the code to calculate the average price using a variable and return it.
VAR AvgPrice = AVERAGE(Products[[1]]) RETURN AvgPriceThe variable AvgPrice calculates the average of the Price column in the Products table.
Fix the error in the code by completing the variable declaration correctly.
VAR TotalQuantity = SUM(Sales[[1]]) RETURN TotalQuantityThe variable TotalQuantity should sum the Quantity column from the Sales table to calculate total units sold.
Fill both blanks to calculate profit as the difference between total sales and total cost.
VAR TotalSales = SUM(Sales[[1]]) VAR TotalCost = SUM(Sales[[2]]) RETURN TotalSales - TotalCost
TotalSales sums the Sales column and TotalCost sums the Cost column. Subtracting gives the profit.
Fill both blanks to calculate the profit margin percentage.
VAR TotalSales = SUM(Sales[[1]]) VAR TotalCost = SUM(Sales[[2]]) VAR ProfitMargin = DIVIDE(TotalSales - TotalCost, TotalSales, 0) RETURN ProfitMargin
TotalSales sums the Sales column, TotalCost sums the Cost column, and ProfitMargin divides profit by total sales to get the margin percentage.