How to Merge Rows in Table Visual in Power BI
Your Power BI report has a table packed with great data, but repetitive entries in the first column make it look busy and hard to scan. If you're coming from an Excel background, your first instinct is probably to look for a "Merge & Center" button to clean it up. While Power BI handles data differently, you can get that same clean, grouped look in your table visuals. This article will show you the best way to merge repeating rows in Power BI to make your reports much easier to read.
Why Merge Rows in a Power BI Table?
Imagine you have a sales report table that breaks down sales by product category and then by the individual product. For every product, the category name is repeated, creating a lot of visual noise. Let's look at an example.
Before Merging:
A standard table might look like this, with the "Category" value repeated for each product:
Electronics | Smartphone | $120,000
Electronics | Laptop | $250,000
Electronics | Headphones | $75,000
Clothing | T-Shirts | $45,000
Clothing | Jeans | $90,000
After "Merging":
The visually grouped version is much clearer and more professional:
Electronics
Smartphone $120,000
Laptop $250,000
Headphones $75,000
Clothing
T-Shirts $45,000
Jeans $90,000
The primary benefits of this approach are:
Improved Readability: Grouping related items under a single heading makes it instantaneous for your audience to see the structure of the data.
Reduced Clutter: Removing redundant text makes your report look cleaner and less intimidating.
Professional Appearance: This formatting style gives your reports a polished look and feel, similar to financial statements or professional business summaries.
The Power BI Way: Using a Matrix Instead of a Table
Power BI doesn't have a direct "merge cells" function like Excel because it’s a data modeling tool, not a spreadsheet program. Its table visuals are built to display rows of data as they exist in your data model. Modifying the display in a way that breaks this one-to-one relationship goes against its core design philosophy.
However, Power BI has a different visual element built specifically for this type of hierarchical grouping: the Matrix visual. The Matrix visual is the official and most effective way to achieve the "merged row" effect. It's incredibly powerful once you know how to format it correctly.
Step-by-Step Guide to Using the Matrix Visual
Let's walk through transforming a standard table with repeating data into a cleanly grouped matrix.
1. Start with a Table or Create a New Matrix
You can either start by creating a Matrix from scratch or convert an existing Table visual. If you already have a Table visual set up, just select it and then click the "Matrix" icon in the Visualizations pane. Power BI will handle the conversion.
For this example, let's assume we have the following fields in our data: Category, Product Name, and Sales Amount.
2. Configure the Matrix Fields
This is the most important step. Unlike a Table visual that has a single "Columns" well, a Matrix has "Rows," "Columns," and "Values" wells. This allows for grouping.
Drag the fields you want to group by into the "Rows" well. Put them in hierarchical order. For our example, drag
Categoryfirst, and then dragProduct Nameunderneath it in the same well.Drag the numerical data you want to display into the "Values" well. In our case, this would be
Sales Amount.
At this point, your visual will look like a "stepped" or indented outline. It's getting closer, but it's not the flat table look we want yet.
3. Format the Matrix to Look Like a Merged Table
Now for the formatting magic. With the Matrix visual selected, go to the Format your visual pane (the paintbrush icon).
Turn Off Stepped Layout: This is the key setting.
Go to the Row headers section.
Find the Stepped layout toggle and turn it Off.
Your matrix will immediately flatten out. The Category will now appear in one column and the Product Name in the next, with the Category items visually grouped—exactly what we're looking for!
4. Final Polishing and Tweaks
To make it look perfect, you might want to adjust a few more settings:
Turn Off Subtotals (Optional): The Matrix automatically adds subtotals for each grouping level. If you don't need them, go to the Row subtotals section in the formatting pane and turn the toggle off.
Remove Expand/Collapse Icons: By default, users can click little
+and-icons to expand or collapse groups. If you want the report to look like a static table, find the Row headers section again, expand it, and turn off the Icons toggle.Adjust Grid and Borders: Navigate to the Grid section. Here you can add horizontal and vertical gridlines and customize their color and thickness to clearly separate rows and columns, further enhancing the "table" look.
After these adjustments, your Matrix will look and feel like a standard table visual but with the first column beautifully merged and grouped.
Alternative Methods for Grouping Data
While the Matrix visual is the best solution nearly 100% of the time, it's good to be aware of a couple of other techniques that address similar data-cleaning goals.
Method 2: Creating Groups in Your Data Model
If your end goal is to simplify a very detailed column into broader categories, you can use Power BI's "Grouping" feature. This doesn't merge cells in an existing visual but rather creates a new, simpler column in your data model that you can use in any visual.
For example, if you had a list of 50 different products, you could group them into logical bundles like "Best Sellers," "New Arrivals," and "Clearance."
How to Create a Group:
In the Data pane on the right, find the field you want to group (e.g.,
Product Name).Right-click the field and select New group.
A dialog box will appear. Hold
Ctrland select multiple values from the list that you want to put into a single group.Click the Group button and give your group a name.
Repeat this for all your desired groups. When you're done, click OK.
Power BI adds a new field to your model (with "(groups)" in the name). You can now drag this new, simplified field into a table, and you'll have fewer repeated values because you are summarizing at a higher level.
Method 3: Concatenating Columns with DAX
This is a situational technique. If you don't want a hierarchical structure but simply want to combine two columns into one for labeling purposes, you can use a DAX calculated column.
For instance, you might want to create a single column showing "Category – Product".
How to Create a Concatenated Column:
Go to the Data view (the table icon on the left).
Select the table you want to add the column to.
From the "Table tools" ribbon, click New column.
In the formula bar, enter a simple DAX formula like this:
Combined Name = 'YourTable'[Category] & " - " & 'YourTable'[Product Name]
Press Enter.
Now you have a new column with combined labels. While this doesn't merge rows in the visual sense, it accomplishes a similar goal of combining information into a single data point, which can sometimes help clean up a report's presentation.
Final Thoughts
Giving your Power BI reports a clean, professional look is crucial for user adoption, and grouping repeating items in a table is a big part of that. While Power BI operates differently than Excel, achieving this "merged cell" effect is straightforward once you know that the Matrix visual, combined with turning off the "Stepped layout" setting, is the right tool for the job.
Manually creating these reports and digging through formatting menus can be time-consuming, especially when you manage dozens of them. At Graphed, we’ve made this process a conversation. Instead of clicking through menus and configuring visuals, you simply connect your data sources and tell our AI analyst what you need using plain English - like "create a report showing sales by product category." It instantly generates a clean, live-updating dashboard, so you can get right to the insights without the manual setup.