Ravindra BagaleCourses & study guides मराठी Track your progress

14. Visuals and Their Formatting

14.18 Matrix

In short: A matrix is Power BI's pivot table: Rows, Columns and Values wells, with subtotals and grand totals.

Start with a problem

Rani wants the Excel-pivot view: cities in rows, categories in columns, sales in the cells, with totals.

Explain simply

A matrix is Power BI's pivot table: Rows, Columns and Values wells, with subtotals and grand totals. It supports drill-down and expand/collapse.

Show the data

City Dairy Fruits Snacks Total
Pune 400 250 200 850
Nashik 650 150 — 800
Kolhapur 0 — 450 450
Total 1,050 400 650 2,100

About this data: This table uses columns: City, Dairy, Fruits, Snacks, Total. This table uses columns: City, Platform, Amount (₹). This table uses columns: City, Amazon Now, Blinkit, Total. Values shown are the lesson examples already on this page (not a new dataset).

Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv (source: src/practice/).

Demonstrate

  1. Insert Matrix.
  2. Rows City, Columns Category, Values Total Sales.
  3. Format › Visual › Row subtotals and Column subtotals › On.
  4. Add Store under City in Rows, then use the + icons (Module 16.4) to expand Pune.

Show the result

Matrix city by category, sample layout with fictional data

Your result should look like this (fictional sample):

City Dairy Fruits Snacks Total
Pune 400 250 200 850
Nashik 650 150 — 800
Kolhapur 0 — 450 450
Total 1,050 400 650 2,100

Explain what happened

Each cell evaluates Total Sales with two filters: its City and its Category. The totals remove one of the filters; the grand total removes both.

Explore further

  • Swap a field from Rows to Columns to pivot.
  • Turn on Show items with no data to display blank combinations (e.g. Nashik Snacks).

Detailed reference for this lesson:

Matrix visual in Power BI with example — in 30 seconds

What: A matrix groups numbers by rows and columns, like a pivot table in Excel, with totals.

Why: The state head wants cities down the side and platforms across the top, with totals.

Tiny example: Rows = City, Columns = Platform, Values = Total Sales. Grand total = ₹2,400.

First look at the data (before → after):

Matrix visual in Power BI with example: before and after tables, fictional Blinkit Maharashtra data

Same before / after tables as text

Before — Orders (flat list)

City Platform Amount (₹)
Pune Blinkit 700
Pune Amazon Now 300
Mumbai Blinkit 600
Mumbai Amazon Now 500
Nashik Blinkit 300

Formula / click path

Matrix: Rows = DarkStore[City] · Columns = Orders[Platform] · Values = [Total Sales]

After — Matrix result

City Amazon Now Blinkit Total
Mumbai ₹500 ₹600 ₹1,100
Nashik — ₹300 ₹300
Pune ₹300 ₹700 ₹1,000
Total ₹800 ₹1,600 ₹2,400

Do it step by step:

  1. Click Matrix in Visualizations.
  2. Drag City to Rows.
  3. Drag Platform to Columns.
  4. Drag [Total Sales] to Values.
  5. Check the totals: Pune ₹1,000 and grand total ₹2,400.
  6. Turn totals on or off in Format › Visual › Row subtotals and Column subtotals.

A cross-tab like an Excel PivotTable, with row/column groups, subtotals and drill.

  • Field wells: Rows, Columns, Values (plus Drill through fields at page level).
  • Example: Rows = Location hierarchy (City › Store Name), Columns = Month Name, Values = Total Orders and Avg Delivery Time (mins).
  • Formatting: Layout and style presets, Grid, Values (Switch values to rows to show measures as rows), Row headers (+/- icons, stepped layout and indent), Column headers, Row subtotals / Column subtotals (per level on/off, position top/bottom), Row grand total / Column grand total, Cell elements (conditional formatting), Specific column.

Tip

Turn Stepped layout off to show each level in its own column, like a classic PivotTable. Turn on +/- icons so users can expand a single city (Module 16.4).

Matrix ha Excel pivot table sarkhach aahe. Excel yet asel tar he ekdum sope vatel.

Ravindra Bagale's Tip

Friends, many students turn on every subtotal and grand total in a matrix, including totals that make no sense, like a sum of percentages. Check each total: ratios need measures that calculate correctly at the total level. Turn off subtotals that don't help, and use the stepped layout for hierarchies. Never forget this.

Fix common mistakes

Wrong result Reason Correction
Column total is not the sum of cells Measure that does not add up (e.g. average, distinct count) Expected for non-additive measures – explain or use SUMX over the rows
Subtotals missing Turned off in format Row/Column subtotals On
Kolhapur Dairy shows 0, Nashik Snacks shows blank 308 is a real row with ₹0; Nashik has no Snacks rows Explain the difference: zero = row exists, blank = no row

Practise independently

Practice task

Make a matrix of City × Platform. Give the Nashik row and the grand total.

Hints
  • Nashik: 303 Blinkit 300, 304 Blinkit 150, 307 Amazon Now 350.
Solution

Nashik: Blinkit ₹450, Amazon Now ₹350, total ₹800. Grand total ₹2,100 (Blinkit 1,100, Amazon Now 1,000).

Think like a professional

Matrices are where totals get questioned. Know why a total can differ from the sum of rows (non-additive measures) – it is a common interview question.

Ravi Sir's Cards for this lesson

मराठी cards