I have a customer dimension:
Dimcust
| Custnum | StartDate | EndDate |
I want to make a new table, using DAX, that for every week in the last year counts the number of customers (distinct custnum) for each week (meaning that the startdate < week and enddate is null or enddate > week).
However I cant get this to work whatsoever.
What I've tried is the following:
Active Users = Calculate(COUNTROWS(filter(DimCustomer; DimCustomer[StartDate].[Date] > WeeklyKPI[Date];DimCustomer[StartDate].[Date] < WeeklyKPI[Date])))
This gave the error:
A single value for column 'Date' in table 'WeeklyKPI' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
Where WeeklyKPI[Date] is a date table with each date in the range I want. If this had worked I've would done the same, just with weeknumbers.
What I want:
Weeknumber | Number of customers
1 13,430
2 32,530