Ravindra BagaleCourses & study guides Track your progress

Guides

The Matrix Visual in Power BI

A matrix is Power BI’s cross-tab: categories down the rows, categories across the columns, and measures in the values — the same idea as a PivotTable, including totals you must check before you trust them.

Friends! A table dumps columns. A matrix answers “City by month”. Why do totals embarrass people? Because a percent was summed like money. How? We build a FreshBasket (fictional) matrix, set the layout, turn on expand icons, and switch off totals that do not add. Grid first, honesty second.

Quick answer

Vertical build:

  1. Insert the Matrix visual.
  2. Rows: City (and a second level if you need it).
  3. Columns: month from the Date table.
  4. Values: measures such as [Total Sales].
  5. Stepped layout on means indent; off means a column per level.
  6. Keep totals for sums. Remove totals for percents that were merely added up.

Real example: city down the side, month across the top

Jan sales Feb sales Mar sales Mar phone bill
Mumbai 800 900 1000 699
Pune 400 420 160 399

Why a matrix: the owner wants the crossing, "Mumbai in March", not a picture. Rows are cities. Columns are months. Values are measures.

What happens:

  1. The Mumbai row is a filter. Only Mumbai slips go in. March sales out: 1000.
  2. The Pune × March cell uses Pune rows only. Sales out: 160.
  3. The phone bill is a second measure, not a third city. March Mumbai bill out: 699. Do not add the bill into the sales total. Different question.
  4. A total of sales across the two cities in March is fair: 1160, if both cities are in the filter.
  5. A total of "percent of the month" is not fair if the visual merely adds 80% + 20%. The percent measure must be calculated again on all rows in that column.

Why FILTER is usually not on this visual: the matrix already filters. City and month are the filters. You write FILTER in a measure only when the cell needs an extra test, such as "sales from slips above 250".

Click Mumbai in a slicer and the Pune row should disappear. If both rows remain, the slicer is not on the same City column as the matrix.

What do I need before this guide?

Before and after (look at the tables first)

Before matrix Flat city-month list.

Before

After matrix Matrix with cities and months.

After

Field wells

Matrix is a cross-tab Rows, columns and values, like a PivotTable, with optional totals. Rows City Columns Month Values Sales grid

A matrix is a cross-tab: rows, columns and values, like a PivotTable.

  1. Click empty canvas, then the Matrix icon.
  2. Rows: Customer[City]. Add Sales[Channel] under it if the second level matters.
  3. Columns: 'Date'[Month Name] or Year-Month. Use the Date table so months sort in calendar order, not alphabetically by accident.
  4. Values: [Total Sales]. Add [Orders] only if the reader can still see the numbers.
  5. If months sort as April, August, December, you sorted text. Fix the sort column on the Date table (month number), not the matrix font.

Layout and expand

Stepped vs columns Stepped layout indents levels; off puts each level in its own column. Stepped indent Off columns +/- expand layout

Stepped layout indents levels; turn it off when you want each level in its own column, and use +/- to expand.

  1. Select the matrix → Format visual.
  2. Stepped layout on: City and Channel share one column, Channel indented. Good when space is tight.
  3. Stepped layout off: each level gets its own column, closer to a classic PivotTable.
  4. Turn +/- icons on so a reader can expand one city without expanding all.
  5. That expand is drill inside the matrix. It is not drill through to another page.
  6. Switch values to rows when several measures should stack vertically under each city.

Totals that lie

Check every total Turn off totals that do not make sense, especially a sum of percents. Sales sum ok % not a sum Off if useless check

A sum of sales can be a total. A sum of percents usually cannot — turn that total off.

  1. Grand total of [Total Sales] is fair if the measure is a sum.
  2. Grand total of a percent column is fair only when the percent measure uses DIVIDE and CALCULATE so the total row recomputes. A visual that adds 20% + 30% + 50% into 100% by luck is not a design.
  3. A total of average delivery minutes is often nonsense. Turn row subtotals or column totals off for that value.
  4. Read the total row yourself before the review. If you cannot explain it, hide it.

A readable matrix

  1. Do not put ten measures in Values. Two is a lesson. Four is a meeting. More is a spreadsheet export.
  2. Widen the row header so City is not cut off.
  3. Repeat the question in the title: “Sales by city and month”.
  4. Use the Filters pane for a year, not twenty slicers around the grid.

Ghabru naka — a matrix that needs a magnifying glass is a table that should have been filtered first.

Mistakes and calm fixes

Symptom Likely cause Fix
Months A–Z Text sort Sort by month number
Percent total is 400% Values were summed Fix the measure, or hide the total
Cannot expand No second row field, icons off Add a level and +/-
Blank months Relationship or filter Date table join, check slicers

Ravindra Bagale's Tip

Interview line: “A matrix is rows, columns and values. I turn off totals that do not make sense, especially summed percentages, and I use +/- only when there is a real hierarchy.” Mention stepped layout if they ask about PivotTable look. Got it?

Practice task

  1. Build City × Month with [Total Sales].
  2. Add Channel under City and expand one city.
  3. Add a percent measure and look at the total row.
  4. Turn that total off if it does not recompute.
  5. Title the visual as a sentence.

Learn it properly

Course lessons:

Related guides: Choose a chart · Percent of total

Got it? Matrix is a cross-tab. Sums can total; many percents cannot. Next: cards and the KPI visual for the numbers above the grid. Let's continue.

Frequently asked questions

Matrix vs table?

A table is a flat list of columns. A matrix groups rows and columns and can show subtotals, like a PivotTable.

What is stepped layout?

Child levels indent under the parent in one column. Turn it off to give each level its own column.

Why is the percent total wrong?

The visual summed the percent values. The percent measure must calculate again at the total, usually with DIVIDE and CALCULATE.

Can I expand one city?

Yes, with +/- icons, after a hierarchy or multiple row fields. That is drill inside the matrix, not drill through.

Switch values to rows?

Use it when several measures should read down the row instead of sitting side by side.

Course lessons?

Matrix in the visuals chapter, and matrix expand/collapse in the drill chapter.