Forum Discussion
looping through past dates
Hi:
I can try to explain. Your table or matrix looks like it is on a daily basis. So that sets the filter context. Because you are analyzing by date, in this case MIN or MAX or AVG all are the same thing.
SELECTCOLUMNS is an iterator, so it will go row by row and you are basically renaming a column(s). Here you are renaming InternetSales[Customer Key] to "Customer Key". But before doing this (FILTER FIRST-EVALUATE SECOND) you are Filltering all the order dates(which have customer keys) in the internet sales table for the time period before any date you examine on your date visual.. (Since your currentdate variable is the same as the date you are looking at in your table.) So on Jan 7th you are looking at any date before Jan 7th to see if any customer key comes up to satisfy your variable named Customers2. This is producing a list of every customer who bought before Jan7th.
Your first variable Customers1 is all the customers buying on jan7th.
So your result is figuring any customer who bought on jan7th(Customer1) that had not bought before this date. This makes them new.
I hope this makes some sense. If your table was monthly, Cusomers1 would be any customer buying in this month and Customers2 would be any customers buying before this month.