Complete the code to create a relationship between two tables in Power BI.
Model = CREATE_RELATIONSHIP('Sales'[CustomerID], [1])
To create a relationship, you connect the key columns from related tables. Here, 'Sales'[CustomerID] relates to 'Customers'[CustomerID].
Complete the DAX formula to calculate total sales amount.
TotalSales = SUM([1])The SUM function should be applied to the 'SalesAmount' column to get total sales.
Fix the error in the DAX formula to calculate average sales per customer.
AverageSales = DIVIDE(SUM('Sales'[SalesAmount]), [1])
To find average sales per customer, divide total sales by the number of unique customers using DISTINCTCOUNT.
Fill both blanks to create a calculated column that flags high sales orders.
HighSalesFlag = IF('Sales'[SalesAmount] [1] 1000, [2], "No")
The IF statement checks if SalesAmount is greater than 1000, then returns "Yes", else "No".
Fill all three blanks to create a measure that calculates sales growth percentage.
SalesGrowth = DIVIDE(SUM('Sales'[SalesAmount]) - CALCULATE(SUM('Sales'[SalesAmount]), [1]), CALCULATE(SUM('Sales'[SalesAmount]), [2])) * 100
This formula calculates the difference between current sales and last year's sales, then divides by last year's sales to get growth percentage. SAMEPERIODLASTYEAR and FILTER functions help select last year's dates.