In the table below, I need to get a unique list of IDs with a count of how many were sold
In the example below, ID #1 was sold twice, #2 zero, #3 one, #4 zero, #5 one.
In order to do this, I have to group it by ID and aggregate with count
But doing so results in 2 for #1 , 1 for #2 (instead of zero), 1 for #3 etc.
In the final result, I do not need the "SoldTo" column, but I do need the Description and OnHand
[TABLE="width: 350"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Description[/TD]
[TD]OnHand[/TD]
[TD]SoldTo[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC[/TD]
[TD]10[/TD]
[TD]John[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC[/TD]
[TD]10[/TD]
[TD]Joe[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]DEF[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]GHI[/TD]
[TD]3[/TD]
[TD]Fred[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]JKL[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]MNO[/TD]
[TD]6[/TD]
[TD]Joe[/TD]
[/TR]
</tbody>[/TABLE]
How can I achieve this with power query
Thanks,
David
In the example below, ID #1 was sold twice, #2 zero, #3 one, #4 zero, #5 one.
In order to do this, I have to group it by ID and aggregate with count
But doing so results in 2 for #1 , 1 for #2 (instead of zero), 1 for #3 etc.
In the final result, I do not need the "SoldTo" column, but I do need the Description and OnHand
[TABLE="width: 350"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Description[/TD]
[TD]OnHand[/TD]
[TD]SoldTo[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC[/TD]
[TD]10[/TD]
[TD]John[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC[/TD]
[TD]10[/TD]
[TD]Joe[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]DEF[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]GHI[/TD]
[TD]3[/TD]
[TD]Fred[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]JKL[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]MNO[/TD]
[TD]6[/TD]
[TD]Joe[/TD]
[/TR]
</tbody>[/TABLE]
How can I achieve this with power query
Thanks,
David
Last edited: