0
0
Power BIbi_tool~10 mins

Pivoting columns in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
AQuantity
BDate
CProduct
DSales
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.
2fill in blank
medium

Complete 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'
AList.Sum([Sales])
BList.Max([Sales])
CList.Min([Sales])
DList.Average([Sales])
Attempts:
3 left
💡 Hint
Common Mistakes
Using average or min/max instead of sum when total sales are needed.
3fill in blank
hard

Fix 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'
AList.Transform([Sales])
BList.Count([Sales])
CList.Sum([Sales])
DList.Sort([Sales])
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.
4fill in blank
hard

Fill 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'
AProduct
BRegion
CSales
DDate
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the pivot column and values column.
Using non-numeric columns for aggregation.
5fill in blank
hard

Fill 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'
ADate
BQuantity
CSum
DSales
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Sales' instead of 'Quantity' for values.
Using aggregation functions other than 'Sum' for totals.