Forum Discussion
H3nning
2 years agoHelper V
Distinct count depending on multiple lines
Hi, i have a problem counting the number of customers that are customers for a certain period of time. Important: I dont want to count them once today, but for any given moment in time! I hav...
- Anonymous2 years ago
Hi H3nning ,
Based on your problems, here are my answers.
First I create three tables as you mentioned.
Then I write a measure.
Formatted Date = FORMAT('Date'[Date], "d.M.yyyy")Finally I write another measure and you will get what you want.
MEASURE = VAR CurrentDate = SELECTEDVALUE ( 'Date'[Formatted Date] ) RETURN CALCULATE ( DISTINCTCOUNT ( Contract[Customer] ), FILTER ( 'Contract', Contract[Start] <= CurrentDate && Contract[End] >= CurrentDate ) )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
H3nning
2 years agoHelper V
Anonymous do you think you can have a look at this too:
I took your idea and I need to develop it further if type of contract is different. Thank you!