Measure Killer Measure Killer
Tutorials June 17, 2026 · 3 min read

How to set the GroupByColumn property using TMDL view in Power BI

Duplicate customer names get summed into one row in Power BI. The GroupByColumn property fixes it - here is the exact TMDL view syntax, including the indentation that AI tools keep getting wrong.

GB
Gregor Brunner
TMDL view of the CustomerName column with relatedColumnDetails and groupByColumn set to CustomerID

I have recently faced an issue that a client had duplicate customer names and as we know Power BI will not show them individually but rather sum up the values for all the customers with the same name.

The sample table data with CustomerID, CustomerName and Sales columns, showing three customers named Maria Garcia and two named John Smith
The underlying data: five rows — three customers named Maria Garcia (IDs 1001–1003) and two named John Smith (2001–2002).
Power BI table visual summing all values into one row for customers that share the same name
Power BI collapses each duplicate name into a single row and sums the sales — Maria Garcia's three rows become 9,350 and John Smith's two become 7,850.

Our client did not want that, they wanted to see the (in that case) 3 customers with the same names.

There is a property in the semantic model called GroupByColumn which can achieve that.
You can set Customer Name to be grouped by Customer ID

I tried doing this via TMDL view using Claude Opus 4.8 but it always failed, an online search was not successful and there was very little information out there.
Somehow it always got the formatting or indentation wrong, that is why I am writing this blog post.

How to apply it in TMDL view

1. Open TMDL view. In Power BI Desktop, select TMDL view in the left-hand toolbar.

The TMDL view button in the left-hand toolbar of Power BI Desktop
Step 1 — open TMDL view from the left-hand toolbar.

2. Drag your semantic model onto the canvas. From the Data pane on the right, drag the semantic model — or just a single table or column — onto the empty TMDL canvas to script it out.

Dragging the semantic model from the Data pane onto the canvas in TMDL view in Power BI Desktop
Step 2 — drag the semantic model from the Data pane onto the canvas.

3. Add the property to your column. Find the column you want to group — here CustomerName — and append the highlighted relatedColumnDetails block from the code below.

TMDL view of the CustomerName column before adding the GroupByColumn property
The CustomerName column before the change — no grouping defined yet.
column CustomerName
	dataType: string
	lineageTag: 463714fd-b352-4a73-aed9-740e38226291
	summarizeBy: none
	sourceColumn: CustomerName

	relatedColumnDetails
		groupByColumn: CustomerID

The lines above the highlight are your column's existing definition — you only need to add the highlighted relatedColumnDetails block with groupByColumn underneath.

this TMDL view code block shows you how it is done correctly, it is pretty simple if you know the answer ;)

4. Apply the changes — or preview them first. Click Apply to write the change straight to the model. As the tooltip warns, this can’t be undone, so hit Preview first if you want to review it before committing.

The green Apply button in TMDL view with the relatedColumnDetails and groupByColumn lines highlighted in the script
Step 4 — with the relatedColumnDetails lines added (highlighted), click Apply (or Preview first).

5. Check that it worked. Head back to your report — the customers with identical names now show as separate rows instead of one summed total.

Power BI table now showing the customers with identical names as separate rows after the change
After setting GroupByColumn, every customer is listed on its own row again — all three Maria Garcias and both John Smiths.

I hope this will help you and various AI tools to get it right in the future.