0
0
Power BIbi_tool~10 mins

Pie and donut charts 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 create a pie chart showing sales by category.

Power BI
PieChart = SUMMARIZE(Sales, Sales[Category], "TotalSales", SUM(Sales[[1]]))
Drag options to blanks, or click blank then click option'
ARegion
BDate
CCustomer
DAmount
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-numeric column like Date or Customer causes errors.
Summing a category or region column instead of amount.
2fill in blank
medium

Complete the DAX measure to calculate the percentage share for each category in the pie chart.

Power BI
CategoryShare = DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Sales[[1]])))
Drag options to blanks, or click blank then click option'
ACustomer
BCategory
CDate
DRegion
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different column in ALL() causes wrong totals.
Not using ALL() results in incorrect percentages.
3fill in blank
hard

Fix the error in the DAX measure to show donut chart values correctly.

Power BI
DonutValue = IF(ISBLANK(SUM(Sales[Amount])), [1], SUM(Sales[Amount]))
Drag options to blanks, or click blank then click option'
A0
BSUM(Sales[Amount])
C1
DBLANK()
Attempts:
3 left
💡 Hint
Common Mistakes
Using BLANK() causes the same blank problem.
Using 1 inflates values incorrectly.
4fill in blank
hard

Fill both blanks to create a measure that calculates the total sales excluding the selected category for the donut chart center.

Power BI
TotalOther = CALCULATE(SUM(Sales[Amount]), [1](Sales[Category]), Sales[Category] [2] SELECTEDVALUE(Sales[Category]))
Drag options to blanks, or click blank then click option'
AALL
BFILTER
C<>
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using ALL removes all filters, not just the selected category.
Using '=' includes only the selected category.
5fill in blank
hard

Fill all three blanks to create a measure that calculates the percentage of total sales for the selected category in a donut chart.

Power BI
SelectedCategoryPercent = DIVIDE(SUM(Sales[[1]]), CALCULATE(SUM(Sales[[2]]), ALL(Sales[[3]])), 0) * 100
Drag options to blanks, or click blank then click option'
AAmount
BCategory
DDate
Attempts:
3 left
💡 Hint
Common Mistakes
Using Date instead of Category in ALL causes wrong totals.
Not multiplying by 100 leaves decimal instead of percent.