Goodday,
I want to use the SUMX function in combination with DISTINCT (PowerPivot + Excel 2010).
For example I have this data:
[TABLE="width: 250"]
<tbody>[TR]
[TD]Productgroup[/TD]
[TD]Product[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]Group Y[/TD]
[TD]product1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Group Y[/TD]
[TD]product2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Group X[/TD]
[TD]product1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Group X[/TD]
[TD]product3[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
Products can be assigned to multiple Productgroups. So product1 is in both, Group Y and Group X. If I create a PivotTable with PowerPivot, the total Sales of Group Y is 9, and total Sales of Group X is 8. However, overall total Sales is 17, while I want it to be 12 (so count product1 only once).
I found out that I should SUMX in combination with DISTINCT, so I created this one:
A new column is created, however, the values, including totals are equal with the ones in de Sales-column. I hope someone can help me with this!
Thanks in advance!
I want to use the SUMX function in combination with DISTINCT (PowerPivot + Excel 2010).
For example I have this data:
[TABLE="width: 250"]
<tbody>[TR]
[TD]Productgroup[/TD]
[TD]Product[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]Group Y[/TD]
[TD]product1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Group Y[/TD]
[TD]product2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Group X[/TD]
[TD]product1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Group X[/TD]
[TD]product3[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
Products can be assigned to multiple Productgroups. So product1 is in both, Group Y and Group X. If I create a PivotTable with PowerPivot, the total Sales of Group Y is 9, and total Sales of Group X is 8. However, overall total Sales is 17, while I want it to be 12 (so count product1 only once).
I found out that I should SUMX in combination with DISTINCT, so I created this one:
Code:
=SUMX(DISTINCT('table'[Product]), [Sales])
Thanks in advance!