I'm trying to work out which customers buy a 1 year licence and then rebuy it 1 year later (actually within 1 year of the expiry). This requires some sort of nested filtering where I find all the distinct customer in the first set and then look how many are in both sets. I searched around a bit and thought i had the answer but doesn't look right as have more in the "both" set than in the 1st set!
Matchinput is a table of invoices with Match Ref being a customer no
1st Set
2nd Set
These seem to be accurate so I then tried to combine them using some other posts, but obviously hopelessly wrong. If anyone can give me a steer how to filter on Set 1st then apply the Set 2 filter to see who is both that would be really appreciated.
Matchinput is a table of invoices with Match Ref being a customer no
1st Set
Code:
PCC Buyer=CALCULATE( DISTINCTCOUNT(MatchInput[Match Ref]),
MatchInput[PCC Purchase]="yes"
)
2nd Set
Code:
PCC Buyer Next Year=
CALCULATE( [PCC Buyer],
DATESINPERIOD(
DateTable[Day],
LASTDATE(
DATEADD(DateTable[Day],1,YEAR)
),
1,
Year
)
)
These seem to be accurate so I then tried to combine them using some other posts, but obviously hopelessly wrong. If anyone can give me a steer how to filter on Set 1st then apply the Set 2 filter to see who is both that would be really appreciated.
Code:
CALCULATE( DISTINCTCOUNT(MatchInput[Match Ref]),
FILTER(
DISTINCT(MatchInput[Match Ref]),
[PCC Buyer Next Year]>0
)
)