Forum Discussion
Delopiero84
4 years agoNew Member
looping through past dates
Hellou guys, I have problem with example below. I am in some DAX course with exercizes , but even with this result I cant get red highlighted part. Task was, identify and count new customers in ...
tamerj1
Community Champion
4 years agoHi Delopiero84
you should manipulate the Date filter context instead.
New customer count =
VAR CurrentDate =
MIN ( 'Date'[Date Key] )
VAR CurrentCustomers =
VALUES ( 'Internet Sales'[Customer Key] )
VAR OldCustomers =
CALCULATETABLE (
VALUES ( 'Internet Sales'[Customer Key] ),
REMOVEFILTERS ( 'Date' ),
'Date'[Date Key] <= CurrentDate
)
RETURN
COUNTROWS ( EXCEPT ( CurrentCustomers, OldCustomers ) )