Complete the code to create a basic bar chart visual in Power BI.
BarChart = SUMMARIZE(Sales, Sales[Product], "TotalSales", [1](Sales[Amount]))
The SUM function adds all sales amounts for each product, which is essential for a bar chart showing total sales.
Complete the DAX measure to calculate the average sales per customer.
AvgSalesPerCustomer = DIVIDE(SUM(Sales[Amount]), [1](Sales[CustomerID]))DISTINCTCOUNT counts unique customers, which is needed to find average sales per customer.
Fix the error in this DAX formula to calculate year-to-date sales.
YTD_Sales = TOTALYTD(SUM(Sales[Amount]), Sales[[1]])The TOTALYTD function requires a date column to calculate year-to-date values correctly.
Fill both blanks to create a calculated table showing total sales by region and year.
SalesByRegionYear = SUMMARIZE(Sales, Sales[[1]], Sales[[2]], "TotalSales", SUM(Sales[Amount]))
Grouping by Region and Year allows the table to show total sales for each region per year.
Fill all three blanks to create a measure that calculates sales growth percentage compared to the previous year.
SalesGrowth% = DIVIDE(SUM(Sales[Amount]) - CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Sales[[1]])), CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Sales[[2]])), 0) * [3]
The Date column is needed for time comparison functions like SAMEPERIODLASTYEAR. Multiplying by 100 converts the ratio to a percentage.