Forum Discussion
Index_Match
4 years agoFrequent Visitor
Measure Repeat Customer by Date
Hi all, I think I have a somewhat easy question, but I'm having a hard time solving. I'm try to find the count of repeat customers by year, comparing this year to the previous year. For example, ...
- 4 years ago
Hi Index_Match
Try this measure [without Date Table]:
Repeat Customers = VAR _A = ADDCOLUMNS ( Customer, "CY", CALCULATE ( DISTINCTCOUNT ( Customer[Customer] ), FILTER ( ALL ( customer ), YEAR ( Customer[Year] ) = YEAR ( EARLIER ( Customer[Year] ) ) - 1 && Customer[Customer] = EARLIER ( Customer[Customer] ) ) ) + 0 ) RETURN SUMX ( _A, [CY] )output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM
4 years agoSuper User
Hi Index_Match
Try this measure [without Date Table]:
Repeat Customers =
VAR _A =
ADDCOLUMNS (
Customer,
"CY",
CALCULATE (
DISTINCTCOUNT ( Customer[Customer] ),
FILTER (
ALL ( customer ),
YEAR ( Customer[Year] )
= YEAR ( EARLIER ( Customer[Year] ) ) - 1
&& Customer[Customer] = EARLIER ( Customer[Customer] )
)
) + 0
)
RETURN
SUMX ( _A, [CY] )
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Index_Match
4 years agoFrequent Visitor
How would the measure need to be adjusted if using a date table?