Complete the code to start a query that folds by referencing the source table.
let Source = Sql.Database("ServerName", [1]) in Source
The Sql.Database function requires the database name as the second argument to connect and enable query folding.
Complete the code to filter rows where the column "Status" equals "Active" and keep query folding.
let FilteredRows = Table.SelectRows(Source, each [Status] [1] "Active") in FilteredRows
The = operator filters rows where the "Status" column exactly matches "Active".
Fix the error in the code to keep query folding when adding a calculated column doubling the "Sales" value.
let AddedColumn = Table.AddColumn(Source, "DoubleSales", each [Sales] [1] 2) in AddedColumn
To double the sales value, multiply the "Sales" column by 2 using the * operator.
Fill both blanks to create a query folding step that groups rows by "Category" and sums "Amount".
let GroupedRows = Table.Group(Source, [1], {{"TotalAmount", [2], "Amount"}}) in GroupedRows
Grouping requires a list of columns, so use {"Category"}. To sum values, use the function List.Sum.
Fill the blanks to create a query folding step that filters rows where "Date" is after 2023-01-01 and selects only "ID" and "Date" columns.
let Filtered = Table.SelectRows(Source, each [Date] [1] #date(2023, 1, 1)), Selected = Table.SelectColumns(Filtered, [2]), Result = Selected in Result
< which filters dates before 2023-01-01.Use > to filter dates after 2023-01-01. The columns to select must be a list, so {"ID", "Date"} is correct.