Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
StuartSmith
Power Participant
Power Participant

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.  

StuartSmith_0-1690298949197.png

 

I have attached an example file.  Public Holidays within Period. 

 

Thanks in advance.

1 ACCEPTED SOLUTION
MBernalBI
Frequent 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))

 

MBernalBI_0-1690362144897.png

I hope that this can help you.

View solution in original post

3 REPLIES 3
MBernalBI
Frequent 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))

 

MBernalBI_0-1690362144897.png

I hope that this can help you.

That worked great.  I was trying "SelectedValue", but wasnt using "DatesBetween" 🙂. Anyway, thanks 

StuartSmith
Power Participant
Power Participant

Is anyone able to assist or advise.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.