Forum Discussion
kastriot
7 years agoFrequent Visitor
Count based on two date columns
Hello, I am trying to count values in [Staff ID] only if the month and year of [ExitDate] match the month and year of [ReportingDate] and I was hoping someone can help me. Thank you
- 7 years ago
First add a calculated column using this formula:
Column = IF(YEAR('Table'[ReportingDate]) = YEAR('Table'[Exit Date]) && MONTH('Table'[ReportingDate]) = MONTH('Table'[Exit Date]),1,0)Then add this measure:
Measure = CALCULATE(COUNT('Table'[Staff ID]), 'Table'[Column] = 1)Workspace on this link.
themistoklis
Community Champion
7 years ago
First add a calculated column using this formula:
Column = IF(YEAR('Table'[ReportingDate]) = YEAR('Table'[Exit Date]) && MONTH('Table'[ReportingDate]) = MONTH('Table'[Exit Date]),1,0)Then add this measure:
Measure = CALCULATE(COUNT('Table'[Staff ID]), 'Table'[Column] = 1)Workspace on this link.