Forum Discussion
lnayak
4 years agoFrequent Visitor
Use a measure 'Active Unique Headcount' using SUMX function.
HeadCount = VAR selectedDate= MAX('Calendar'[Date] RETURN SUMX('EDE'[Worker #], VAR WorkerStartDate = ('EDE'[MinStartDate]) VAR WorkerEndDate = ('EDE'[MaxEndDate]) RETURN IF ( WorkerStartDate<...
- Anonymous4 years ago
Hi lnayak
Based on your formula, I created a simple sample.
Original data :
Then use the formula you provided . I modified it to return the value 1 or 0 .
HeadCount = VAR selectedDate=MAX('Calendar'[Date]) VAR _WorkerStartDate= SELECTEDVALUE(EDE[MinStartDate]) VAR _WorkerEndDate = SELECTEDVALUE(EDE[MaxEndDate]) RETURN IF ( _WorkerStartDate<=selectedDate && _WorkerEndDate>=selectedDate,1,0)Then create a measure to count the total value .
count = SUMX('EDE',[HeadCount])The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lnayak
4 years agoFrequent Visitor
Hi,
Let me explain what am looking for am trying to work on headcount formula and if sumx doesn't work i need to change it to distinct count. can someone help me out here please?