cancel
Showing results for
Did you mean:
Helper III

## Open days to count ?

Hello,

I'm working on a dax to calculate the open days in a month. For example, I would like to calculate the open days of March month. So the dax that I wrote is :

OD = CALCULATE(DISTINCTCOUNT('Calendar'[Date]),FILTER('Calendar','Calendar'[Month]=MONTH(NOW())+1))

So the result is: 31 days, is the number of all days of March month.
Do you have any tips to calculate the open days of any month?

Regards,
1 ACCEPTED SOLUTION
Super User II

Suppose you have Date Column with Date format so create a new Calculated Column like below:

WeekdayFlag = if(weekday('Calendar'[Date]) = 1,0,if(weekday('Calendar'[Date])=7,0,1))
Then take only Month in table and above calculated column so you'll something like below:
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, and Sales Analysis Report
5 REPLIES 5
Super User IV

@Hicham , Not very clear what is open days?

Total day in current month = day(eomonth(Today(),0)

Total day in next month = day(eomonth(Today(),1)

Proud to be a Super User!

Helper III

@amitchandak Open days are the days that we work on: from Monday to Friday. Example for March the open days are 23, not 31. I would like to calculate it for all months  !

Regards,

Super User IV
``Work Day = COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(EOMONTH(TODAY(),0)+1, EOMONTH(TODAY(),1)),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1))``

Proud to be a Super User!

Super User II

Suppose you have Date Column with Date format so create a new Calculated Column like below:

WeekdayFlag = if(weekday('Calendar'[Date]) = 1,0,if(weekday('Calendar'[Date])=7,0,1))
Then take only Month in table and above calculated column so you'll something like below:
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, and Sales Analysis Report
Super User IV

@Hicham , for next month

``Work Day = COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(EOMONTH(TODAY(),0)+1, EOMONTH(TODAY(),1)),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1))``

Proud to be a Super User!

Announcements