Forum Discussion

manideep547's avatar
manideep547
Helper III
6 years ago

Active and Inactive customers

Hi all, 
I need active customers count and inactive customers count Active customers are within the 6 months and Inactive customers are +6months 
table A
id     date   
1        1/1/2018     
1       1/1/2019

2        1/2/2018 

2        1/12/2018

3       1/1/2016

3         1/1/2017

4         1/1/2015

4         1/8/2015
1          1/8/2017

when I filter the data in slicer from 1/1/2018 to 1/1/2019, here Active customers id is 1 and count is 1 and Inactive customers are 2 and count is 1
here I try the formula but getting error 

CALCULATE(
      DISTINCTCOUNT( TableA[ID] )   ),
    DATESINPERIOD( TableA[DATE].[Date], MAX( TableA[DATE].[Date] ), -6, MONTH )
)

A date column containing duplicate dates as specified in the call to function 'DATESINPERIOD'.

8 Replies