Power BI: Create a Table Within a Table (Nested Rows)
In this article
Power BI does not have a native "table within a table" visual, but you can achieve the effect with a matrix that has row hierarchies expanded, or by embedding a small table as an HTML table inside a text box or custom visual. The most practical method is the matrix visual: add multiple fields to the Rows well, then turn on stepped layout and expand all levels so each parent row shows its child rows indented beneath it, looking like a nested table. For a true side-by-side table inside a table cell, you need a custom visual such as HTML Content or a workaround with DAX-generated HTML. This guide covers both approaches, with the matrix method as the primary solution because it uses only built-in features.
What You'll Need
- Power BI Desktop (current version) or Power BI Service with edit permissions on a dataset.
- A dataset with at least two related fields you want to nest, for example Category and Product, or Region and Store.
- Basic familiarity with the Visualizations pane and the Fields well.
- For the HTML method: a custom visual from the official AppSource store (only install visuals from Microsoft-certified sources).
Step-by-Step
Method 1: Nested Rows with a Matrix Visual (Built-in)
- Open your report in Power BI Desktop and select the Matrix visual from the Visualizations pane. Note that menu labels can differ slightly by version and region.
- Drag your parent field (for example Category) into the Rows well.
- Drag your child field (for example Product) into the Rows well directly beneath the parent field. The order matters: the first field is the outer level, the second is the inner level.
- Drag a numeric measure (for example Sales) into the Values well so each row has data to display.
- In the Format pane, open Row headers and turn on Stepped layout. This indents the child rows under the parent, which is what makes it read as a table within a table.
- Still in Row headers, set the option to expand all levels down to the lowest level. In the visual itself, click the expand icon (the small arrow or plus sign) on each parent row, or use the expand all levels icon in the visual header.
- Optional: turn off Subtotals for the inner level if you only want the nested rows, or leave them on to show a per-parent total.
- Resize the visual and adjust column widths by dragging the header dividers so the nested rows are readable.
The result is a single visual where each parent row contains its child rows, visually resembling a table inside a table. It is not a separate table object, but it delivers the same reading experience for most reports.
Method 2: A True Table Inside a Cell Using a Custom Visual
- In Power BI Desktop, open the Visualizations pane and click the ellipsis (three dots) to get more visuals, then choose Get more visuals to open AppSource. Install only a certified HTML or table-rendering visual from a trusted publisher.
- Add the custom visual to your report canvas.
- Create a DAX measure that builds an HTML string containing a table. For example, use CONCATENATEX over your child table to produce rows of HTML with
<tr>and<td>tags, wrapped in<table>tags. Keep the HTML simple: the visual renders what you pass. - Add your parent field to the visual's grouping or rows well, and add the HTML measure to the values well.
- In the visual's format settings, ensure HTML rendering is enabled if the visual exposes that toggle.
- Test with a small category first. If the table renders as raw text, the visual is not interpreting HTML; check the visual's documentation for the correct field well or setting.
This method gives a genuine table inside each parent row, but it depends on a third-party visual and on writing correct DAX. Keep the HTML minimal and escape any user text to avoid broken markup.
Common Mistakes
- Putting both fields in the Columns well instead of Rows. That creates a cross-tab, not nested rows.
- Forgetting to turn on Stepped layout, so child rows appear as flat siblings rather than indented.
- Leaving the matrix collapsed at the top level and concluding the nesting did not work. Expand the parent rows.
- Adding too many levels. Three or more nested fields become hard to read on a normal page; limit to two unless the audience needs the detail.
- Using a custom visual from an unverified publisher. Stick to certified visuals and review permissions before publishing.
- Building HTML in DAX without escaping text, which can break the table layout or display raw tags.
Tips
- Use a matrix rather than a table visual when you need nesting; the table visual does not support row hierarchies the same way.
- Set consistent column widths and font sizes so the indented child rows line up cleanly.
- Turn off the parent-level subtotal if it clutters the nested view, and keep only the grand total.
- If you need the nested table to appear in a tooltip, build a separate small matrix page and use it as a report page tooltip.
- For export or email, the matrix exports its visible expanded state, so expand the levels you want before exporting.
- Name your measures clearly (for example Sales HTML Row) so report maintainers understand the HTML approach.
Troubleshooting
If the child rows do not appear, confirm both fields are in the Rows well and that Stepped layout is on. If the expand icon is missing, the visual may be at the lowest level already or the field is a measure rather than a column. If the matrix shows only totals, check that a measure is in Values and that the rows are not filtered out by a slicer. If the custom visual shows raw HTML tags, the visual is not rendering HTML; verify the correct field well and any render toggle in its settings. If the report is slow after nesting, reduce the number of levels or aggregate the child field. If the layout breaks after publishing, compare the Desktop and Service versions and republish from the current Desktop build. If a custom visual fails to load in the Service, confirm it is allowed by your tenant's visual settings; an admin may need to permit it.
Frequently Asked Questions
Can Power BI show a real table inside another table?
Not with a built-in visual. The matrix with nested rows is the standard workaround; a true embedded table requires a custom visual that renders HTML.
Why do my nested rows show as flat rows?
Stepped layout is off, or the parent rows are collapsed. Turn on Stepped layout in the Row headers settings and expand the levels.
Does the matrix export with the nested rows expanded?
It exports the state you see, so expand the levels you need before exporting to PDF or PowerPoint.
Can I nest more than two fields?
Yes, you can add more fields to the Rows well, but readability drops quickly. Two levels is usually the practical limit for a report page.
Is a custom visual safe to use?
Only if it comes from a certified publisher in AppSource and your tenant allows it. Check with your Power BI admin before publishing.
Can I put a nested table in a tooltip?
Yes, by creating a separate report page with a small matrix and assigning it as a tooltip page for the visual.