Forum Discussion
Anonymous
2 years agoNot applicable
Partner Count
Hi All, I have the below To scenarios to get the partner count. Scenario 1--> To calculate the count of partners who did not do sales in last year and did sales in the current year are the new Cust...
Anonymous
2 years agoNot applicable
mwegener
2 years agoMost Valuable Professional
Hi Anonymous ,
I would perform the customer count on the sales table.
The code should then look something like this.
The calendar table must be marked as a date table for the time logic.
new Customers =
VAR _customersPreviouseYear = CALCULATE(DISTINCTCOUNT(Sales[CUSTOMERCODE]), PARALLELPERIOD('Master_Calendar'[Date],-1,YEAR))
VAR _customersBothPeriods = CALCULATE(DISTINCTCOUNT(Sales[CUSTOMERCODE]), UNION(PARALLELPERIOD('Master_Calendar'[Date],-1,YEAR),PARALLELPERIOD('Master_Calendar'[Date],0,YEAR)))
RETURN
_customersBothPeriods - _customersPreviouseYear
lost Customers =
VAR _customersThisYear = CALCULATE(DISTINCTCOUNT(Sales[CUSTOMERCODE]), PARALLELPERIOD('Master_Calendar'[Date],0,YEAR))
VAR _customersBothPeriods = CALCULATE(DISTINCTCOUNT(Sales[CUSTOMERCODE]), UNION(PARALLELPERIOD('Master_Calendar'[Date],-1,YEAR),PARALLELPERIOD('Master_Calendar'[Date],0,YEAR)))
RETURN
_customersBothPeriods - _customersThisYear
- Anonymous2 years agoNot applicable
Hi mwegener ,
Thanks for the response, but issue not yet resolvedAs per the above measure im getting the below error when i'm adding data to matrix visual with year and values