Power BI does not provide a direct button to merge table cells or group individual cells into a single visual block. To achieve this, you must use the “Data Groups” feature within a visual’s formatting pane to nest tables or create a parent-child hierarchy that visually separates data.

What You'll Need

  • A Power BI Desktop or Service account with permissions to edit or create reports.
  • A dataset containing the data you wish to visualize in a table format.
  • Basic understanding of your data hierarchy (e.g., Country > State > City if grouping by location).

Step-by-Step

  1. Open your report: Launch Power BI Desktop or navigate to your report in the Power BI Service. Select the visual containing the data you want to modify.
  2. Format the visual: With the visual selected, go to the Format your visual pane on the right-hand side. If it is not visible, click the Format icon (the paint roller).
  3. Locate the Data Groups section: In the formatting pane, scroll down until you find the Data groups section. This section allows you to create nested tables or group data rows.
  4. Add a Data Group: Click the Add a data group button. This will create a new entry at the bottom of the list. You can rename this entry by clicking the pencil icon next to the text (e.g., rename it to “Region Group”).
  5. Select the grouping field: In the “Group by” dropdown, select the field that should determine the grouping. For example, if you have a column for “Country,” selecting that will group all rows by country.
  6. Set the visual type: Look for the “Visual type” setting. You can choose from options like “Column chart,” “Table,” or “Card.” Selecting “Table” will create a sub-table for each group, effectively creating the grouping effect.
  7. Configure the nested table (Optional but Recommended): If you chose “Table” in the previous step, click the Table link or expand the settings for that specific group. Here, you can select which columns appear in the inner table. This allows you to show detailed data only within the grouped rows while keeping the summary level clean.
  8. Adjust spacing and borders: In the “Data groups” section, you can adjust the spacing between groups and the borders of the groups. Increasing the spacing makes the groups more distinct, simulating the effect of merged cells. You can also adjust the background color of the groups to make them stand out further.
  9. Review the visual: Click the visual to see the result. The data should now be organized into distinct blocks or sub-tables based on your chosen field. You can further adjust the hierarchy by adding multiple data groups or by dragging and dropping fields in the Fields pane.

Common Mistakes

Using the wrong visual type: Some users try to achieve grouping by changing the main visual type to a chart, which can lose the tabular data structure. Always ensure the visual type within the Data Group settings is set to “Table” if you need to see rows of data.

Not selecting the correct field: Grouping by a field that is not unique or is too granular (like a unique ID) will result in every row being its own group. Select a field with distinct categories, such as “Region,” “Department,” or “Year,” to get meaningful groups.

Ignoring the Field Pane: While Data Groups handle the visual nesting, the underlying data structure matters. Ensure your data is in a tabular format (one table with columns) rather than a matrix format (multiple tables linked by relationships) if you plan to use the Data Groups feature directly on the visual.

Tips

Use alternating row colors: To make the grouped rows easier to scan, enable alternating row colors in the main formatting pane. This contrast helps the eye distinguish between the end of one group and the start of the next.

Dynamic grouping: If you want the grouping levels to change based on user selection (e.g., a slicer), use a slicer on your grouping field. The Data Groups will update automatically to reflect the selected items.

Drill-down behavior: If you want users to click a group to expand it and see details, consider using the “Drill down” feature in the visual options. This provides a more interactive way of handling grouped data.

Troubleshooting

Visual not grouping: If the visual does not group as expected, check that the field you selected in the “Group by” dropdown actually exists in the visual’s dataset. Sometimes, a field that is visible in the Fields pane is not included in the visual’s data context.

Groups appearing as one large block: If the groups are not visually distinct, check the spacing settings in the Data Groups section. Increasing the spacing value will push the groups apart. Also, ensure that the background color of the groups is set to a different color than the main table background.

Data not updating: If the groups do not update when you change a slicer, verify that the Data Group field is not being filtered out by another visual. Sometimes, a filter on the same field in a different visual can override the grouping logic.

Frequently Asked Questions

Can I merge cells in Power BI like in Excel?

No, Power BI does not have a native “Merge Cells” feature. The workaround is to use Data Groups to create nested tables or parent-child hierarchies that visually separate the data.

How do I group by multiple fields?

You can create multiple Data Groups. To group by, for example, Country and then State, add a Data Group for Country, and then add a second Data Group for State. The second group will be nested within the first.

Can I use Data Groups on a Matrix visual?

Data Groups are specifically designed for visuals that display data in a tabular or hierarchical format, such as Tables and Trees. They are not supported on Matrix visuals or certain other chart types.

Why are my groups not expanding?

If you are using a Tree visual with Data Groups, ensure that the “Drill down” feature is enabled in the visual options. If you are using a Table visual, the groups are typically always expanded by default.

Does Data Groups work in the Power BI Service?

Yes, Data Groups are supported in both Power BI Desktop and the Power BI Service. However, the ability to edit the formatting of a visual may be restricted depending on the permissions assigned to your account.