Forum Discussion
Count records based on 2 date fields in same table
Hi emenard
It is doable. Can you please post some sample data in excel format on one drive and share the link.
Cheers
CheenuSing
- Anonymous9 years agoNot applicable
Hi emenard
Try the following steps.
1. The date ( calendar) dimension table should not be linked to the employee table.
2. Create the meassure
Started = CAlculate(Countrows(HRTable), FIlter (HRTable,HRTable[Employment start] >= Min('Calendar'[Date]) && HRTable[Employment start]<= MAx('Calendar'[Date])))
3. Ended = CAlculate(Countrows(HRTable), FIlter (HRTable,HRTable[Employment end] >= Min('Calendar'[Date]) && HRTable[Employment end]<= MAx('Calendar'[Date])))
4. Replace the HRTable with your employee table name and Calendar with your date dimension table.
5. Sample output based on the sample data.
If this works for you please accept this as solution and also give KUDOS.
Cheers
CheenuSing
- v-ljerr-msft9 years ago
Microsoft Employee
Hi emenard,
Just finished the test, and the solution is the same as Anonymous's here. :smileylol:
In addition, here is the sample pbix file for your reference. :smileyhappy:
Regards