Forum Discussion
DistinctCount per startdate
Hi RemiAnthonise ,
You can create measure like DAX below.
Count=
Var c=CALCULATE(COUNT(Table1[Bereken Van]), FILTER(ALLSELECTED(Table1), Table1[Patient Code]=MAX(Table1[Patient Code])))
Var d= CALCULATE(DISTINCTCOUNT(Table1[Patient ID]), FILTER(ALLSELECTED(Table1), Table1[Patient Code]=MAX(Table1[Patient Code])))
Return
IF(c>2, d+1,d)
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- RemiAnthonise6 years agoHelper V
Hi v-xicai Amy,
Thanks for your reply. This is not exactly what I'm looking for.
The outcome of your Count gives me 2 where I expect this: the sum of my Count is 23.
I marked some rows in red: this is the same Patient (code) but a patient gets transfered. You see a change in the Bereken Van (startdate) and his Patient ID changes.
In green, you see a patient without any transfers / changes in dates. He is there for 3 days so I only want to count this one as 1 on the 26th.
What I want to create here is for all the incoming patients. When we have this I can change it to all the outgoing patients. That should be easy of we can solve this one.
Hope this is clear.
- RemiAnthonise6 years agoHelper V
Hi v-xicai Amy,
Sorry to bother you with this but if you have time to check my issue, I'd really appreciate it.
Thanks.
- RemiAnthonise6 years agoHelper V
Hi v-xicai or someone else:
I'm getting close to the deadline I have for this report and I haven't found the solution yet. Can you help me with this one?
Thanks!