Forum Discussion
StuartSmith
Power Participant
3 years agoCount number of rows within date range. (Example file attached)
I'm trying to count the number of public holidays for a country within a table visual, but cant seem to get it working, its just counting all the public holidays. I have attached an examp...
- 3 years ago
I have made a DAX measure and I recommend it to do this type of calculation.
Public Holidays = var _minDate = SELECTEDVALUE('Time to Fill'[Position Open Date]) var _maxDate = SELECTEDVALUE('Time to Fill'[Vacant Position Filled With Today If Still Vacant]) return CALCULATE(COUNTROWS('Public Holidays'),DATESBETWEEN('Public Holidays'[Holiday Date],_minDate, _maxDate))I hope that this can help you.
MBernalBI
3 years agoFrequent Visitor
I have made a DAX measure and I recommend it to do this type of calculation.
Public Holidays =
var _minDate = SELECTEDVALUE('Time to Fill'[Position Open Date])
var _maxDate = SELECTEDVALUE('Time to Fill'[Vacant Position Filled With Today If Still Vacant])
return
CALCULATE(COUNTROWS('Public Holidays'),DATESBETWEEN('Public Holidays'[Holiday Date],_minDate, _maxDate))
I hope that this can help you.
StuartSmith
Power Participant
3 years agoThat worked great. I was trying "SelectedValue", but wasnt using "DatesBetween" 🙂. Anyway, thanks