Complete the code to create a simple measure that sums sales in Power BI.
Total Sales = SUM([1])The SUM function adds all values in the Sales Amount column.
Complete the code to filter data for the year 2023 in Power BI using DAX.
Filtered Sales = CALCULATE(SUM(Sales[Amount]), Sales[Year] [1] 2023)
The = operator filters rows where the year is exactly 2023.
Fix the error in this DAX measure to calculate average sales per customer.
Avg Sales per Customer = DIVIDE(SUM(Sales[Amount]), [1](Customers[CustomerID]))COUNT counts the number of customer IDs to divide total sales correctly.
Fill both blanks to create a calculated column that flags high sales over 1000.
High Sales Flag = IF(Sales[Amount] [1] 1000, [2], "No")
The IF function checks if sales are greater than 1000 and returns "Yes" if true.
Fill the blank to create a measure that calculates sales growth percentage.
Sales Growth % = DIVIDE(SUM(Sales[Amount]) - CALCULATE(SUM(Sales[Amount]), Sales[Year] = [1](Sales[Year]) - 1), CALCULATE(SUM(Sales[Amount]), Sales[Year] = [1](Sales[Year]) - 1))
This formula calculates the difference between current year sales and previous year sales, then divides by previous year sales to get growth percentage. CALCULATE changes context, and MAX gets the current year.