Power BI Matrix also called as Cross tab, is useful to display the relationships between two or more than two groups. Let me show you how to Create a Matrix in Power BI with example.
For this Power BI Matrix demonstration, we are going to use the SQL Data Source that we created in our previous article. So, Please refer to Connect to SQL Server article to understand the Power BI Data Source.
How to Create a Matrix in Power BI
When you drag any dimension field to the Canvas, Power BI automatically creates a table. Let me drag and drop the English Product Name from the Fields section to Canvas. And you can see the table.
Next, let me drag one metric value (Sales Amount) to the Values section and click on the Matrix under the Visualization section.
Clicking the button will automatically convert a Table into a Matrix. From the screenshot below, you can see the corss tab representation of English Product names and Sales Amount.
Let me add one more column group so that you can understand the cross tab. As you can see, we added Customer gender to the Column Groups.
Create a cross tab in Power BI Approach 2
If you want to convert the existing chart into Power BI Matrix, then you can follow this step. As you can see from the screenshot below, we created a column chart, which represents the Order Quantity by English Product Subcategory.
Click on the below shown icon under the Visualization section automatically convert the Column Chart into a cross tab.
Let me add the Product Color to the Column Group
To create it, First, click on the Power BI Matrix present in the Visualization section. It automatically creates a cross tab with dummy data. Next, let me add the product Color as the Row Group.
Next, drag and drop the English Occupation to the Column Groups. Now, you can see the cross tab.
Next, let me drag the Sales Amount to the Values section. It automatically enables the Subtotals and grand totals.
For this Power BI Matrix demonstration purpose, we are adding one more metric field, i.e., Total Product Cost to the Values section.
Let me do some quick formatting to this Power BI Matrix
NOTE: I suggest you refer to Format a Cross Tab article to understand the formatting options.