How to Set Column Width in Power BI Matrix Visual?

Would you like to learn how to adjust the column width of a Matrix visual in Power BI? I will help you to do that for your Matrix visual in your Power BI report.

Power BI Desktop has an “auto-size column width” feature that automatically resizes the width of the Power BI matrix column depending on the size of the value.

In this Power BI tutorial, I will explain how to set the column width of a matrix visual in two different methods.

  • Manual Resizing the Column Width of Matrix Visual
  • Set Fixed Column Width of a Matrix Visual in Power BI

Fix Column Widths in Power BI Matrix using Manual Resizing

Let’s explore how to resize the column widths in a Power BI matrix visual.

Power BI will automatically set the auto width for a new column based on the values present in that column. You can manually resize the column width of a matrix by turning off the “Auto Size Column width” option and then resizing the columns manually.

This is the matrix visual I have created, with the ‘Products Data’ where Rows are with ‘Product‘, Columns are with ‘Region‘, and Values are with ‘ Sum of Sales Quantity’. You can see the image presented below.

Column Width in a Matrix Power BI

To do that, follow the quick steps below:

  1. On the Power BI desktop canvas, select your matrix visual. Go to the Visualization pane and select Format your visual icon. Then, expand the Column headers and Toggle off the ‘Auto-size width‘ option.
Set Column Width Power BI Matrix
  1. In the next step, you can resize the columns of a Matrix visual by hovering the mouse between column headers until the cursor changes. Then click and drag the column to resize. You can see the output like in the screenshot below:
Power BI matrix column width sizing

This is how to manually resize the width of a column in the Power BI matrix visual.

Check out How to Sort Column Values in Matrix Visual Power BI?

Set Fixed Column Width in a Power BI Matrix Visual

In this section, let’s see how to set equal column width for a matrix visual by creating a new measure and the REPT function in Power BI.

Below, you can see that I have created a matrix visual on the Power BI desktop with the Financial details:

  • In the Row field, drag and drop the ‘ Product‘ from the Field Pane.
  • In the column field, drag and drop the ‘Country‘ from the field pane.
  • In the Value field, add ‘Sum of Profit‘ from the Field Pane.
Power BI Matrix Column Width

From the screenshot above, you can see the width of the matrix columns before resizing.

Here are the steps to follow to set the fixed column width across the matrix table:

  1. First, let’s create a new measure for the column width using the REPT function. Click on New Measure from the Home tab and add the expression below. You can replace the name.
  2. Then, the created measure will be displayed under the Data pane. According to your requirement, you can specify the width while creating a measure. Refer to the image.
Column_Width = REPT("0",16)
Column Widths in a Matrix Power BI
Power BI Matrix Visual Column Width
  1. Then, go to the “Format your visual” section under the visualization pane, expand the “Value” section, and toggle the “Switch values to rows” option on.
Set Fixed Column Width in Matrix in Power BI
  1. Now, drag and drop the measure we have created to the value field. It will resize the column of the matrix visual. Save the Matrix to a Power BI report.

From the screenshot below, you can see the matrix visual resized to all columns.

Matrix column widths in a Power BI
  1. Next, select the Matrix, open the ‘Column headers‘ in the formatting section, and toggle off the ‘Auto size column width’. Next, save again.
Fix Matrix Column Width in Power BI
  1. Then, click the Build Visual icon and select the Matrix Visual. Remove the measure from the visualization; the size of the column in the matrix column persists even if a new column is added. Save it to Power BI by clicking Ctrl+S.
Set column widths in matrix Power BI

From the screenshot below, you can see that the column width is equal across the Power BI Matrix table.

Set Fixed Column Width in a Power BI Matrix Visual

This way, you can fix the column width in the Power BI matrix visual.

I hope you learned the new method for setting the column width in a Matrix visual in Power BI.

You may also like the following Power BI tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…