Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS MATH

Power BI Table and Matrix


Share

Table and Matrix

Tables and matrices show exact numbers in rows and columns.

Use them when readers need to look up values, not just see a pattern.

TableMatrix
WellsColumnsRows, Columns, Values
LayoutA flat list, one row per itemGrouped rows and columns, like a PivotTable
TotalsOne Total rowA subtotal for every group, plus grand totals
LevelsOne levelLevels you can expand and collapse

If you know Excel, a matrix works much like a PivotTable.

This page uses your file from the DAX chapter, for example poke_mart_dax.pbix (see Power BI Visuals for what it holds), with the measures Units Sold, Total Sales and Margin %.


Create a Table

Build a table with one row per product:

  1. Click an empty spot on the canvas.
  2. In the Visualizations pane, select Table.
  3. In the Data pane, expand Products and select Product.
  4. Expand Sales and select the measures Units Sold, Total Sales and Margin %, in that order.

Power BI adds the four fields to the Columns well, in the order you selected them.

The order of the fields in the well is the order of the columns in the table.

To move a column, drag its field up or down in the well.

A table visual with the columns Product, Units Sold, Total Sales and Margin % for the ten Poke Mart products and a Total row, and the Columns well in the Visualizations pane holding the same four fields

Your table should show these values.

Here the rows are sorted by Product, A to Z:

ProductUnits SoldTotal SalesMargin %
Antidote1,799179,90055.00%
Awakening722180,50052.00%
Great Ball2,7961,677,60045.00%
Hyper Potion515618,00043.33%
Paralyze Heal978195,60052.50%
Poke Ball9,1081,821,60045.00%
Potion5,0901,527,00050.00%
Revive482723,00040.00%
Super Potion2,2081,545,60045.71%
Ultra Ball790948,00041.67%
Total24,4889,416,80045.58%

The Total Row

Look at the Total row.

Units Sold and Total Sales are the sums of the rows above.

Margin % is different.

The total is not the sum of the ten percentages (470.21%), and not their average either (47.02%). It is 45.58%.

That is because Power BI does not add up the numbers you see.

It calculates every total with the measure itself, over all the rows in the total.

For the Total row, DIVIDE([Profit], [Total Sales]) is calculated for all products together.

This is why ratios like Margin % must be measures.

You can read more about it in DAX Context.

Sort a Table

Select a column header to sort the table by that column.

A small arrow in the header shows the sort order.

Select the header again to reverse the order.

Sorted by Total Sales, largest first, Poke Ball (1,821,600) is at the top and Antidote (179,900) is at the bottom.

Sorted by Margin %, largest first, Antidote comes first with 55.00%.

A cheap product can have the best margin and the smallest sales.

A table lets readers see all three measures at once.



Create a Matrix

Now build a matrix with regions and stores down the side and years across the top:

  1. Click an empty spot on the canvas.
  2. In the Visualizations pane, select Matrix.
  3. In the Data pane, expand Stores and select Region. It goes to the Rows well. Then drag Store to the Rows well, below Region. Drag it, do not select its check box: with the check box, Power BI puts Store in the Columns well. You can also drag the Region > Store hierarchy from the Hierarchies chapter to Rows.
  4. Expand the Date table and drag Year to the Columns well. Drag it, do not select its check box: Year is a number, so the check box could add it to Values as a sum of years.
  5. Expand Sales and select Total Sales. It goes to the Values well.

The matrix starts at the top level of the rows.

It shows one row per region, and one column per year:

Region20242025Total
Hoenn1,324,7001,647,3002,972,000
Johto1,612,4501,751,2003,363,650
Kanto1,456,0501,625,1003,081,150
Total4,393,2005,023,6009,416,800

Every region sold more in 2025 than in 2024.

Expand and Collapse

The stores are hidden inside the regions.

There are two ways to show them:

  • Select the + next to a region, for example Johto, to show only Johto's stores. Select the - to hide them again.
  • Point to the matrix and select Expand all down one level in the hierarchy in the icons above or below the visual. This shows the stores of every region.

A new matrix shows the + icons by default.

You can turn them off in Format visual > Visual > Row headers > +/- icons.

Fully expanded, the matrix looks like this:

A fully expanded matrix with regions and their stores in the rows, the years 2024 and 2025 and a Total column across the top, and Total Sales values, next to the Rows, Columns and Values wells in the Visualizations pane

These are the values of the expanded matrix.

The bold rows are the regions:

Region / Store20242025Total
Hoenn1,324,7001,647,3002,972,000
Lilycove City598,550774,9001,373,450
Slateport City726,150872,4001,598,550
Johto1,612,4501,751,2003,363,650
Goldenrod City1,070,6501,209,9002,280,550
Violet City541,800541,3001,083,100
Kanto1,456,0501,625,1003,081,150
Cerulean City832,100834,4501,666,550
Viridian City623,950790,6501,414,600
Total4,393,2005,023,6009,416,800

Now you can see something the region rows hid: Violet City is the only store that sold less in 2025 (541,300) than in 2024 (541,800).

The other drill icon, Go to the next level in the hierarchy, shows the stores without the regions above them.


Subtotals and Grand Totals

A matrix has three kinds of totals:

  • Row subtotals: the bold region rows. Each one is the total of its stores. In the default layout, called Compact, the subtotal is on the same row as the region name.
  • Column subtotals: the Total column, which adds up the years.
  • Grand total: the Total row at the bottom, 9,416,800.

Just like in the table, Power BI calculates each subtotal with the measure, for all the rows in that group.

To change the totals, select the matrix, select Format visual, and open the Visual tab:

  • Turn off Row subtotals to hide the row totals. This hides the grand Total row at the bottom too.
  • Turn off Column subtotals to hide the Total column.
  • To show Region and Store in two separate columns, like a classic PivotTable, expand Layout > Matrix layout and choose Outline or Tabular instead of Compact.

Note: A table has only one Total row, and no subtotals.

If you need subtotals by group, use a matrix.



Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.