Complete the code to return the top 5 products by sales amount.
TopProducts = TOPN([1], Sales, Sales[Amount], DESC)The TOPN function needs the number of items to return as the first argument. Here, 5 returns the top 5 products.
Complete the code to return the top 3 customers by total sales.
TopCustomers = TOPN([1], Customers, Customers[TotalSales], DESC)To get the top 3 customers, the first argument of TOPN should be 3.
Fix the error in the TOPN function to correctly return the top 4 products by quantity sold.
TopProductsByQty = TOPN([1], Products, Products[Quantity], DESC)The first argument must be a number indicating how many rows to return. Here, 4 is correct.
Fill both blanks to return the top 3 salespersons by total sales amount in descending order.
TopSalespersons = TOPN([1], Salespersons, Salespersons[[2]], DESC)
The first blank is the number of top rows, 3. The second blank is the column to sort by, TotalSales.
Fill all three blanks to return the top 5 products by sales amount sorted in descending order.
TopProducts = TOPN([1], Products, Products[[2]], [3])
The first blank is 5 for top five products, second blank is Amount column, third blank is DESC for descending order.