Complete the code to remove duplicate rows from the dataset.
CleanData = DISTINCT([1])The DISTINCT function removes duplicate rows from the specified table. Here, we apply it to the 'Sales' table to clean duplicates.
Complete the DAX formula to calculate the total sales after filtering out blank values.
TotalSales = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, Sales[Amount] [1] BLANK()))The filter condition uses '<>' to exclude blank values from the 'Amount' column, ensuring only valid sales are summed.
Fix the error in the DAX formula to calculate average sales correctly.
AverageSales = AVERAGE([1][Amount])The correct table name is 'Sales'. Using 'Sales[Amount]' correctly references the column for averaging.
Fill both blanks to create a calculated column that flags sales above average.
SalesFlag = IF(Sales[Amount] [1] Sales[AverageAmount], [2], "Below Average")
The IF statement checks if 'Amount' is greater than 'AverageAmount'. If true, it returns 'Above Average', else 'Below Average'.
Fill all three blanks to create a measure that counts non-blank sales records in 2023.
SalesCount2023 = CALCULATE(COUNTROWS([1]), FILTER([2], YEAR([3][Date]) = 2023 && NOT(ISBLANK([3][Amount]))))
All references should be to the 'Sales' table to count rows where the year is 2023 and the Amount is not blank.