Forum Discussion
lozg
3 years agoRegular Visitor
Count rows before date with a condition
Hi there, I'm having trouble adding another conditon to a DAX - to determine the number of voluntary leavers in a specified period. For all leavers, the DAX I'm using is: var mindate = calculate(...
- 3 years ago
[Measure] = var mindate = calculate(min( 'Calendar'[Date]), ALL('Calendar'[Date]) ) var maxdate = calculate( max('Calendar'[Date]), ALLSELECTED('Calendar'[Date]) ) var cnt = CALCULATE( COUNTROWS(Master), DATESBETWEEN( 'Calendar'[Date], mindate, maxdate + 1 ), keepfilters( Master[Turnover Reason] = "voluntary" -- DAX is case-insensitive ), USERELATIONSHIP( 'Calendar'[Date], Master[Termination Date] ) ) return cnt
amitchandak
3 years agoSuper User
- lozg3 years agoRegular Visitor
Thank you for the suggestion Amit!
I'll have a look over the blog to get some ideas on useful metrics.