Forum Discussion

StuartSmith's avatar
StuartSmith
Icon for Power Participant rankPower Participant
3 years ago
Solved

Count 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...
  • MBernalBI's avatar
    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.