Complete the code to rename the column 'Sales' to 'Total Sales' in Power Query.
Table.RenameColumns(Source, [1])In Power Query, to rename a column, you use Table.RenameColumns with a list of pairs: the old name and the new name. Here, we rename 'Sales' to 'Total Sales'.
Complete the code to remove the column 'Discount' from the table in Power Query.
Table.RemoveColumns(Source, [1])The Table.RemoveColumns function removes columns by name. The column name must match exactly, including case. Here, 'Discount' is the correct column to remove.
Fix the error in the code to reorder columns so that 'Date' comes first in Power Query.
Table.ReorderColumns(Source, [1])The Table.ReorderColumns function requires a list of column names as text strings in the desired order. The column names must be exact and enclosed in quotes.
Fill both blanks to rename 'Profit' to 'Net Profit' and remove the 'Cost' column in Power Query.
let Renamed = Table.RenameColumns(Source, [1]), Removed = Table.RemoveColumns(Renamed, [2]) in Removed
First, rename the 'Profit' column to 'Net Profit' using Table.RenameColumns. Then remove the 'Cost' column with Table.RemoveColumns. Both functions require lists with exact column names.
Fill all three blanks to reorder columns to ['Region', 'Date', 'Sales'], rename 'Sales' to 'Total Sales', and remove 'Discount' in Power Query.
let Reordered = Table.ReorderColumns(Source, [1]), Renamed = Table.RenameColumns(Reordered, [2]), Removed = Table.RemoveColumns(Renamed, [3]) in Removed
First, reorder columns to have 'Region', 'Date', and 'Sales' in that order. Then rename 'Sales' to 'Total Sales'. Finally, remove the 'Discount' column. Each step uses the correct function with proper lists.