Pesumably you have a column that is negative or positive. Then
total = calculate(distinctcount(sales[trans]),sales[qty] > 0) - calculate(distinctcount(sales[trans]),sales[qty] < 0)
This is what i tried:
TRANS# DISTINCT COUNT2:=CALCULATE(DISTINCTCOUNT('SALES TABLE'[TRANS#]),'SALES TABLE'[UNITS SOLD]>0)-CALCULATE(DISTINCTCOUNT('SALES TABLE'[TRANS#]),'SALES TABLE'[UNITS SOLD]<0)
Here's the strange part if I add up all the transactions it's correct. But yet the total shows a higher amount?
[TABLE="width: 542"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]LOC#[/TD]
[TD]FULL NAME[/TD]
[TD]ADS[/TD]
[TD]UNITS[/TD]
[TD]RETAIL[/TD]
[TD]TRANS# DISTINCT COUNT2[/TD]
[/TR]
[TR]
[TD]7000[/TD]
[TD]Jennifer F[/TD]
[TD="align: right"]$173[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]$1,733[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Antonette P[/TD]
[TD="align: right"]$187[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]$1,681[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Venessa B[/TD]
[TD="align: right"]$246[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]$1,473[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Kaitlin E[/TD]
[TD="align: right"]$153[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]$610[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Christina Q[/TD]
[TD="align: right"]$85[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]$511[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Andrea M[/TD]
[TD="align: right"]$169[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]$337[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Julia F[/TD]
[TD="align: right"]$230[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]$230[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Leyla M[/TD]
[TD="align: right"]-$165[/TD]
[TD="align: right"]-1[/TD]
[TD="align: right"]-$165[/TD]
[TD="align: right"]-1[/TD]
[/TR]
[TR]
[TD]7000 Total[/TD]
[TD][/TD]
[TD="align: right"]$173[/TD]
[TD="align: right"]46[/TD]
[TD="align: right"]$6,410[/TD]
[TD="align: right"]34[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD][/TD]
[TD="align: right"]$173[/TD]
[TD="align: right"]46[/TD]
[TD="align: right"]$6,410[/TD]
[TD="align: right"]34[/TD]
[/TR]
</tbody>[/TABLE]
Total should be 35 not 34?