I have rows of data in Power BI, each row has a duplicate row which has different numerical values. I want to add each row with the duplicate and make it appear as 1 row.
Please how can I solve this.
I have rows of data in Power BI, each row has a duplicate row which has different numerical values. I want to add each row with the duplicate and make it appear as 1 row.
Please how can I solve this.
Suppose, you have such table:
Then you may use following code:
let
Source = Excel.CurrentWorkbook(){[Name="Table"]}[Content],
group = Table.Group(Source, {"col1", "col2"}, {"temp", each let x = [col3]{0} in Table.TransformColumns(_, {"col3", each x})}),
combine = Table.Combine(group[temp])
in
combine
to get this result:
If you need to keep order of rows, just add index column before grouping, then sort it after combine step.
I am not entirely sure what you are looking for, but it looks pretty close to the group by operation. You can group up values in the "Transform" tab under "Edit Query". Once you get to the Transform tab, select "Group By" and choose the desired criteria. This will let you group up the values and sum the numerical values. Hope this helps.