Bird
Raised Fist0
Power BIbi_tool~10 mins

Pie and donut charts in Power BI - Interactive Code Practice

Choose your learning style10 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.

Practice

(1/5)
1. What is the main purpose of a pie chart in Power BI?
easy
A. To list data in rows and columns
B. To show parts of a whole as slices of a circle
C. To compare two numerical values side by side
D. To display trends over time with lines

Solution

  1. Step 1: Understand pie chart basics

    A pie chart divides a circle into slices representing parts of a whole.
  2. Step 2: Compare with other chart types

    Line charts show trends, bar charts compare values, tables list data. Only pie charts show parts of a whole as slices.
  3. Final Answer:

    To show parts of a whole as slices of a circle -> Option B
  4. Quick Check:

    Pie chart = parts of whole [OK]
Hint: Pie charts always show parts of a whole circle [OK]
Common Mistakes:
  • Confusing pie charts with line charts
  • Thinking pie charts show trends over time
  • Using pie charts for detailed data tables
2. Which of the following is the correct way to add a donut chart in Power BI?
easy
A. Select the donut chart icon from the Visualizations pane
B. Write a DAX formula to create a donut chart
C. Use the Data view to draw a donut chart manually
D. Insert a pie chart and then change its color to white

Solution

  1. Step 1: Identify how to add visuals in Power BI

    Power BI provides a Visualizations pane with icons for different charts.
  2. Step 2: Find the donut chart icon

    The donut chart icon is available to select directly; no DAX or manual drawing is needed.
  3. Final Answer:

    Select the donut chart icon from the Visualizations pane -> Option A
  4. Quick Check:

    Donut chart = Visualizations pane icon [OK]
Hint: Use the Visualizations pane icons to add charts [OK]
Common Mistakes:
  • Trying to create charts with DAX formulas
  • Using Data view to draw charts manually
  • Changing colors to fake chart types
3. Given a dataset with categories and sales, what will a donut chart show if you drag 'Category' to Legend and 'Sales' to Values?
medium
A. A bar chart comparing sales amounts
B. A line showing sales trend over categories
C. A table listing sales by category
D. Slices representing sales share of each category

Solution

  1. Step 1: Understand donut chart data fields

    Legend defines slices (categories), Values define slice sizes (sales amounts).
  2. Step 2: Interpret the visual output

    The donut chart will show slices sized by sales share per category, not trends or tables.
  3. Final Answer:

    Slices representing sales share of each category -> Option D
  4. Quick Check:

    Legend + Values = slices sized by values [OK]
Hint: Legend = slices, Values = slice size in pie/donut charts [OK]
Common Mistakes:
  • Expecting a line or bar chart from a donut chart
  • Confusing legend with axis in charts
  • Thinking donut charts show raw numbers, not shares
4. You created a donut chart but it shows only one slice instead of multiple categories. What is the likely cause?
medium
A. The 'Category' field was not added to the Legend well
B. The 'Sales' field is empty or zero for all categories
C. The donut chart does not support multiple slices
D. The data model has no relationships

Solution

  1. Step 1: Check the Legend field in the donut chart

    If 'Category' is missing or not properly added to Legend, the chart shows one slice.
  2. Step 2: Verify other options

    Empty sales would show no slices, donut charts support multiple slices, and relationships affect filtering but not basic slices.
  3. Final Answer:

    The 'Category' field was not added to the Legend well -> Option A
  4. Quick Check:

    Legend missing = one slice [OK]
Hint: Always add categories to Legend for multiple slices [OK]
Common Mistakes:
  • Assuming donut charts can't show multiple slices
  • Ignoring the Legend field placement
  • Blaming data model relationships for slice count
5. You want to show total sales in the center of a donut chart along with category slices. Which feature should you use in Power BI?
hard
A. Use the donut chart's center text option to display total sales
B. Enable the 'Detail labels' and set 'Label style' to 'Data value and percentage'
C. Add a card visual on top of the donut chart manually
D. Create a measure that sums sales and add it to Legend

Solution

  1. Step 1: Understand donut chart limitations

    Built-in donut charts do not have a direct center text option for totals with multiple category slices; the center category label works only for single categories.
  2. Step 2: Apply best practice workaround

    Create a total sales measure, add a Card visual to display it, and manually position the card in the donut's center hole. Other options fail: no center text (A), labels on slices (C), legend misuse (D).
  3. Final Answer:

    Add a card visual on top of the donut chart manually -> Option C
  4. Quick Check:

    Card overlay = donut center total [OK]
Hint: Overlay Card visual in donut center for totals [OK]
Common Mistakes:
  • Believing donut charts have native center text for totals
  • Adding totals to Legend field
  • Using detail labels expecting center display
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard