Forum Discussion
counting rows based on multiple dates
- 4 years ago
Anonymous , refer if one of the two blogs can help
Hey Anonymous ,
Go on your table first_of_mth and count each month nbr active customer from here:
Best regards,
philouduv - thanks for your reply. I've tried 2 variations of your suggestion. Both generated error messages - see below. Can you spot what's wrong?
nbr_custo = CALCULATE(COUNT(customer[customer]),
FILTER(all(prod),
customer[startdate] <= first_of_mth[mth_start_date]
&&
customer[stopdate] > first_of_mth[mth_start_date]))
Error message: A single value for column 'mth_start_date' in table 'first_of_mth' cannot be determined…
nbr_custo = CALCULATE(COUNT(customer[customer]),
FILTER(all(customer),
customer[startdate].[Date] <= first_of_mth[mth_start_date].[Date]
&&
customer[stopdate].[Date] > first_of_mth[mth_start_date].[Date]))
Error message: Column reference to 'startdate' in table 'customer' cannot be used with a variation 'Date' because it does not have any.