Trying to Understand the New Customers Measure

I have been able to setup the New Customers measure from the “Customer Attrition” course and I have it working. I have even played around with the measure in DAX Studio returning different variables and I can see it working. But to be honest, I am having trouble understanding how/why it works. Here is the formula…

New Customer Sales =
Var Customers = VALUES(Sales[CustomerID])

RETURN
COUNTROWS(
FILTER(
Customers,
CALCULATE(COUNTROWS(Sales),
FILTER(ALLSELECTED(‘Date’),‘Date’[Date] < MIN(‘Date’[Date])))
= 0 )
)

So my bottom line question is…

How is the final CALCULATE statement being joined with the Customers list variable within the FILTER function? I just don’t see how the final countrows and date filter (BOLD) are being joined with / applied to the customer list variable (ITALICS).

Thanks for any further explanation you can provide? I am trying to understand this vs just accepting it. :smiley:

Hi,

Can you share the course link from where you get this dax .

Thanks,
Anurag

It’s Advanced Analytics in Power BI. Customer Attrition. Thanks!

It’s when he talks about New Customers.

@patrickcox

1 Like

Thanks. I guess it is the CALCULATE function that initiates the Context Transition. I appreciate your help.

@patrickcox Yup, that’s correct.