Forum Discussion
Active Customers in Financial Year
- 7 years ago
Hi
I think I have solved it:
Active Customers =
VAR FinalActCust = CALCULATE(DISTINCTCOUNT(SALESLINE[CUSTACCOUNT]), FILTER(SALESLINE,SALESLINE[DELIVERY DATE] >= DATE(2016,04,01) && SALESLINE[DELIVERY DATE] <= DATE(2017,03,31) && SALESLINE[DEPOT] = "UK"))
RETURN
FinalActCustThanks for the help anyway
The Active Customers is not proper DAX syntax, can you double check?
I see 2 issues in the last conditional
IF([Last Sales Date],DATESBETWEEN('DATE'[Date],01/04/2016,31/03/2017),TotalActive,BLANK())1) [Last Sales Date] is not TRUE/FALSE statement, so IF will always return TRUE (except for 1 date from 1900s)
2) your IF has 4 arguments instead of 3 - Logical test, TRUE value, FALSE value, the BLANK in the end is not proper
The variable TotalActive returns the number of unique customers, not the list of unique customers
what do you want to achieve in the end? do you want to see how many of the [CUST 2016-17] customer bought something during that financial year?
- Qualube7 years ago
Helper II
Hi Thanks for the reply
Yes in essence I do want to find out how many customers bought in any particular financial year.
Appreciate the help.
- Qualube7 years ago
Helper II
Hi
I think I have solved it:
Active Customers =
VAR FinalActCust = CALCULATE(DISTINCTCOUNT(SALESLINE[CUSTACCOUNT]), FILTER(SALESLINE,SALESLINE[DELIVERY DATE] >= DATE(2016,04,01) && SALESLINE[DELIVERY DATE] <= DATE(2017,03,31) && SALESLINE[DEPOT] = "UK"))
RETURN
FinalActCustThanks for the help anyway