Hi below is a DAX measure I use to count the number of unique sales each day.
Unfortuantly I can’t seem to get it to work properly. Each day on it’s own is correct as to the number of unique transactions. But when it totals a week or more the amounts for each day don’t equal the calculated day.
Thoughts?
TRANS# DISTINCT COUNT:=SUMX (
ADDCOLUMNS (
SUMMARIZE (
‘SALES TABLE’,
‘SALES TABLE'[TRANS#],
“NetUnitsSold”, SUM ( ‘SALES TABLE'[UNITS SOLD] )
),
“SalesTranCount”, IF ( [NetUnitsSold] > 0, 1, IF ( [NetUnitsSold] < 0, -1 ) )
),
[SalesTranCount]
)