Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to pivot the 'Sales' column by 'Region'.
Power BI
PivotTable = Table.Pivot(Source, List.Distinct(Source[Region]), "Region", [1], List.Sum)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a column that is not numeric for pivot values.
Using the column name for rows instead of values.
✗ Incorrect
The pivot operation requires the column to aggregate, which is 'Sales' here.
2fill in blank
mediumComplete the code to aggregate sales by summing after pivoting.
Power BI
PivotTable = Table.Pivot(Source, List.Distinct(Source[Region]), "Region", "Sales", [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using average or min/max instead of sum when total sales are needed.
✗ Incorrect
Summing sales is common to get total sales per region after pivot.
3fill in blank
hardFix the error in the pivot code by choosing the correct aggregation function.
Power BI
PivotTable = Table.Pivot(Source, List.Distinct(Source[Region]), "Region", "Sales", [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using List.Transform or List.Sort which do not aggregate to a single value.
Using List.Count which counts items but does not sum values.
✗ Incorrect
List.Sum correctly aggregates sales values; others cause errors or wrong results.
4fill in blank
hardFill both blanks to pivot sales by 'Product' and aggregate by sum.
Power BI
PivotTable = Table.Pivot(Source, List.Distinct(Source[[1]]), "[1]", [2], List.Sum)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the pivot column and values column.
Using non-numeric columns for aggregation.
✗ Incorrect
Pivoting by 'Product' and aggregating 'Sales' by sum shows total sales per product.
5fill in blank
hardFill all three blanks to pivot 'Quantity' by 'Date' and aggregate by sum.
Power BI
PivotTable = Table.Pivot(Source, List.Distinct(Source[[1]]), "[1]", [2], List.[3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Sales' instead of 'Quantity' for values.
Using aggregation functions other than 'Sum' for totals.
✗ Incorrect
Pivoting by 'Date' with 'Quantity' values aggregated by List.Sum gives total quantity per date.