How to Add Multiple Columns in Power BI Matrix?

Do you know how to add multiple columns in Power BI Matrix?

In this Power BI tutorial, I will tell you how to add multiple columns in Power BI Matrix visual and set matrix column widths in a Power BI with various examples.

How to Add Multiple Columns in Power BI Matrix

I will tell you how to add multiple columns in the Power BI Matrix. Like the following:

In the image below, you can see there is a Category column. Under the Category, there are four types of columns, i.e.

  • Furniture
  • Office Supplies
  • Technology

Also, the Sub-Category columns are the Bookcases, Chairs, Furnishings, Tables, Appliances, Art, Binders, etc.

Power BI Matrix Multiple Columns

I have a SharePoint list(Oders) that I would like to use for this example. This list has these many columns below with different data types:

ColumnsData Types
Product NameSingle line of text
CategorySingle line of text
Sub-CategorySingle line of text
SalesCurrency
QuantityNumber
Add Multiple Columns in Power BI Matrix visual

1. Open Power BI Desktop and lode data. Then, the data set is shown in the Data panel.

how to add two columns in power bi matrix

2. Under the Visualizations panel, click Matrix Visual. Then, drag Year into Rows, Category and Sub-Category into Columns, and Sales into Values field.

How to Add Multiple Columns in Power BI Matrix

3. To see multiple columns in the matrix visual, click on the drill-down future in the matrix visual.

how do i add multiple rows in power bi matrix

This way, you can see multiple columns in the Power BI matrix visual, but It isn’t easy to understand. To make it easy to understand, we add some formatting. Follow the below steps.

4. Select the matrix visual -> select Format your visual -> click Visual -> expand Grid -> Enable Horizontal gridline and add Color -> Enable Vertical gridline and add Color.

Adding Gridlines to Matrix columns in Power BI

5. Select the matrix visual -> select Format your visual -> click Visual -> disable Column subtotal.

How to Remove Grand Total From Matrix in Power BI

This way, you can add basic formatting to the Power BI Matrix visual.

How to Set Matrix Column Widths in a Power BI

I will tell you how to set equal widths in each cell in Power BI Matrix Visual.

1. Open Power BI Desktop and lode data. Then, the data set is shown in the Data panel.

how to add two columns in power bi matrix

2. Under the Visualizations panel, click Matrix Visual. Then, drag Year into Rows, Sub-Category into Columns, and Sales into Values field.

FIX MATRIX COLUMN WIDTH IN POWER BI

3. Now, under the Home tab, click the New measure.

How to set matrix column widths in a Power BI report

4. In the formula bar, put the below DAX formula. Then click Commit.

Width = REPT( "!",20)
Set Fixed Columns Width in Matrix in Power BI

5. Remove the Sum of Sales using “X” and drag the new measure(Width) into the Value field.

Power BI matrix columns width sizing

6. Then go to the Visualizations panel -> select Format your visual -> select Visual -> Expand Column headers -> Expand Options -> Off Auto-size width.

How to Adjust Column Width in Power BI Matrix

7. Remove the Width using “X” and drag the Sales into the Value field.

How to Set Matrix Column Widths in a Power BI

Now, you can see the matrix visual. All column widths are the same.

Conclusion

I hope you follow all the steps to add multiple Power BI Matrix Visual columns. In this tutorial, I explained how to add multiple columns in Power BI Matrix Visual and set matrix column widths in a Power BI.

Also, you may like some more Power BI tutorials: