Topic 5 · Power BI  ›  Week 10

Power BI — More Chart Types

Every chart from Chapter 2, now in Power BI: line, bar, stacked and clustered columns, histogram, box plot and maps. You'll also meet the one data problem that stops most students cold — wide vs long format.

By the end of this week you can…

  • Build line and bar charts with proper titles and axis labels.
  • Choose between clustered and stacked columns, and say why.
  • Make a histogram using bins, and a box plot from a custom visual.
  • Plot a geospatial bubble map by district.
  • Unpivot wide data into long format so a multi-line chart works.
One file, nine sheets. Load Week 10 Datasets once and tick every sheet in the Navigator. Each example below tells you which sheet to use. And as always — check your data types first.

10.1  Line chart — monthly sales trend

The situation. A retail shop wants to analyse sales performance across 2024. The owner suspects sales fluctuate with seasonal demand and festive promotions, and has recorded total monthly sales to check.

Sheet: Example 3 (Line Chart).

  1. Import the dataset — make sure the date column really is a date type.
  2. Insert a Line chart: Month → X-axis, Sales → Y-axis.
  3. Title: “Monthly Sales Trend – 2024”.
Expected result — steady growth across 2024
JanJunDec RM1,200 RM3,500

Sales grew steadily from January (RM1,200) to December (RM3,500) — continuous upward growth rather than the seasonal spikes the owner expected. That's a finding worth reporting.

10.2  Bar chart — sales by product category

The situation. A retail company wants to evaluate monthly sales across product categories, for a team meeting.

Sheet: Example 4 (Bar Chart).

  1. Insert a Stacked column chart: Product Category → X-axis, Sales (RM) → Y-axis.
  2. Title: “Monthly Sales by Product Category – August 2025”.
  3. Label the vertical axis “Sales (RM)” and the horizontal axis “Product Categories”.
  4. Apply distinct bar colours.
● Reading the result

Electronics leads at RM45,000; Books trails at RM12,000. The chart tells the manager which categories are performing and which need attention — that sentence, not the chart itself, is the finding.

10.3  Clustered vs stacked — patient visits

The situation. A hospital administrator wants to compare patient visits by department for August and September 2025, to spot trends and allocate resources.

Sheet: Example 5 (Stack & Cluster).

  1. Insert a Clustered column chart: Department → X-axis; August Patients and September Patients → Y-axis.
  2. Title: “Patient Visits by Department – Aug vs Sep 2025”.
  3. Set the legend to Top centre. Rename the Y-axis fields so the legend reads cleanly (“August”, “September” — not “Sum of August Patients”).
  4. Axis titles: horizontal “Departments”, vertical “Number of Patients”.
  5. Turn on data labels and position them sensibly.
  6. Use different colours for the two months.
  7. Now switch the visual to a Stacked column chart and move the data labels to inside centre.
Clustered — for comparing

Bars sit side by side. Best when the question is “did this department go up or down between August and September?” — growth and decline read instantly.

Stacked — for totals

Bars sit on top of each other. Best when the question is “what was each department's total across both months, and how did the months contribute?”

● Same data, different question

Neither chart is “better” — they answer different questions. Stacked totals are easy to read but comparing the upper segments across departments is hard, because they don't share a baseline. If the comparison matters more than the total, cluster it.

● Session 1 recap

Line for trends over time, bars for comparing categories. Clustered when comparing groups, stacked when the total matters. Always retitle the axes and rename fields so the legend reads like English.

10.4  Histogram — distribution of patient age

The situation. A hospital ran a community health screening, collecting age, systolic blood pressure and BMI. The administrator wants to see the distribution of these variables.

Sheet: Example 6 (Histogram & Boxplot).

Power BI has no histogram button. You make one by binning a numeric column, then charting the counts.

  1. Insert a Column chart. Drag Age → X-axis, Patient ID → Y-axis (it becomes a count).
  2. In the Data pane, right-click AgeNew group → group type Bin, bin size 10.
  3. Put the new Age (bins) field on the X-axis instead.
  4. Title: “Age Distribution of Patients”. X-axis: “Age of Patients”. Y-axis: “Frequency of Patients”.
Expected result — age distribution, bin size 10
10s20s30s40s 50s60s70s80s Age of patients (10-year bins)

A roughly normal distribution — most patients fall between 30 and 70, tapering at both ends. Bin size drives the shape: too small and it's noise, too large and the pattern disappears.

Want a proper histogram visual? Open Visualizations ▸ Get more visuals and search “histogram”. Add one and explore it — custom visuals often handle binning better than the workaround above.

10.5  Box plot — a custom visual

Power BI has no built-in box plot either, so you import one.

  1. Visualizations ▸ Get more visuals → search “box and whisker” → add it.
  2. For a single box plot: drag BMI into Category, Sampling and Values.
  3. For box plots by group: Category = Cat (M/F), Sampling = Patient ID, Values = BMI.
  4. Customise colours and titles as you like.
● Reading the result

Comparing the two groups, the male distribution is skewed to the right while the female distribution is closer to normal. That shape difference is invisible in a bar chart of averages — which is exactly why box plots exist.

10.6  Geospatial — sales by district

The situation. A retail chain in Kelantan wants to see 2024 sales by district, to find which contribute most and which need marketing or a new store.

Sheet: Example 7 (Geospatial).

  1. Visualizations ▸ Map.
  2. District → Location; Sum of Sales → Bubble size.
  3. Format the visual:
    • Map settings → style Aerial; turn map labels off
    • Legend → off
    • Bubbles → adjust the size data range
    • Category labels → on
    • Under Colour, choose the monthly sales measure
  4. Title: “Total Sales (RM) by District”.
● Reading the result

Kota Bharu has the largest bubble — the highest total sales — followed by Pasir Mas. Kuala Krai is smallest. Bubble size encodes value, so the map answers “where” and “how much” at the same time.

10.7  Wide vs long — the reshaping problem

Here's the one that catches everyone. To draw several lines on one chart, Power BI needs the data in long format: one column naming the group, one column holding the value. Google Sheets wanted the opposite — wide format, one column per group.

Same data, two shapes
WIDE — one column per district DateKotaBharuPasirMasKualaKrai Jan1200085006000 Feb1250087006200 LONG — one row per observation DateDistrictSales JanKota Bharu12000 JanPasir Mas8500 UNPIVOT → select the district columns, right-click → Unpivot Columns ← PIVOT Transform ▸ Pivot Column turns long back into wide

Power BI wants long; Google Sheets wanted wide. Power Query converts between them in two clicks.

10.8  Practice

● Practice 3 · Multi-line chart (uses unpivot)

Sheet: Practical 3. A retail company sells in three Kelantan districts — Kota Bharu, Pasir Mas and Kuala Krai. Management wants to compare monthly sales trends (Jan–Dec 2024) across all three in one chart.

  1. Open Transform Data (Power Query).
  2. Select the three district columns → right-click → Unpivot Columns.
  3. Close & Apply.
  4. Insert a Line chart: Date → X-axis, Value → Y-axis, Attribute (the district) → Legend.
  5. Title: “Monthly Sales Trends by District (Kelantan, 2024)”.

Then answer: which district shows the strongest growth from January to June 2024? How does Kota Bharu's growth compare with Pasir Mas and Kuala Krai?

● Practice 4 · Clustered bar — staffing

Sheet: Practical 4. A construction company is reviewing how workers are distributed across two projects — Highway Expansion and Office Tower — to balance staffing and spot shortages. Build a clustered bar chart comparing the number of workers by role on both sites.

● Practice 5 · Player analysis

Sheet: Practical 5. A soccer head coach wants to analyse player data — position, goals scored, weekly training hours and sprint speed — for training and game-day decisions.

  • Build a histogram of Goals Scored and comment on the distribution.
  • Build a box plot of Sprint Speed and comment on its distribution.
  • Compare total goals by position with a bar chart.
● Challenge · Boss level

Sheet: Challenge — Boss Level. A retail company tracks monthly sales and customer satisfaction across three Kelantan districts and wants to understand distribution, trends and customer experience.

  • Compare sales by district in June 2024 using a bar chart.
  • Show the sales trend (Jan–Jun 2024) by district using a multi-line chart.
  • Show the distribution of total sales for each district using a box plot.

This one combines everything from Weeks 9 and 10 — reshaping, three chart families, and a judgement call about which chart answers which question.

Key terms & definitions

Clustered column
Bars side by side — for comparing groups against each other.
Stacked column
Bars on top of each other — for totals and each part's contribution.
Bin
A numeric range used to group values; bin size controls a histogram's shape.
Custom visual
A chart type not built in, added from Get more visuals — how you get a box plot.
Bubble map
A map where each location is a circle sized by value.
Wide format
One column per group — what Google Sheets wants for a multi-series chart.
Long format
One row per observation, with a group column and a value column — what Power BI wants.
Unpivot
Power Query operation turning wide into long.
Pivot column
The reverse — turning long back into wide.

✅ Quick self-check

1. You want to compare each department's August and September figures side by side. Use…

2. To make a histogram in Power BI you first…

3. Your three districts are in three separate columns and the multi-line chart won't work. You…

4. Power BI has no built-in box plot. You get one by…

5. On a bubble map, bubble size encodes…

Week 11 →