cancel
Showing results for
Did you mean:
Helper II

## Count of days YTD and Year w/o Weekends

Hello,

I would like to ask your help to figure out the measure formula i can use to obtain the results highlighted in Yellow. The YTDnoWeekends shows the count of weekdays each month however for the current month it only counts the days till yesterday (12/6). The YEAR woWeekends is the count of days per month for the whole year without the weekends.

1 ACCEPTED SOLUTION
Microsoft

Here are two measure expressions that should work. Replace 'Date'[Date] with your actual date column.

YearNoWeekends =
CALCULATE (
COUNT ( 'Date'[Date] ),
FILTER (
VALUES ( 'Date'[Date] ),
WEEKDAY ( 'Date'[Date] ) IN { 2, 3, 4, 5, 6 }
)
)

YTDNoWeekends =
CALCULATE (
COUNT ( 'Date'[Date] ),
FILTER (
VALUES ( 'Date'[Date] ),
'Date'[Date] <= TODAY ()
&& WEEKDAY ( 'Date'[Date] ) IN { 2, 3, 4, 5, 6 }
)
)

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

2 REPLIES 2
Super User

Hi,

Here's another approach.  Write this calculated column formula in the Calendar Table

Weekday number = weekday(Calendar[Date],2)

Write this measure

Measure1 = calculate(countrows(Calendar),Calendar[Weekday number]<=5)

Ensure that the month name field in your visual has been dragged from the Calendar Table.  Please also ensure that one year has been selected in the Year slicer (which in turn should be from the Calendar Table).

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Microsoft

Here are two measure expressions that should work. Replace 'Date'[Date] with your actual date column.

YearNoWeekends =
CALCULATE (
COUNT ( 'Date'[Date] ),
FILTER (
VALUES ( 'Date'[Date] ),
WEEKDAY ( 'Date'[Date] ) IN { 2, 3, 4, 5, 6 }
)
)

YTDNoWeekends =
CALCULATE (
COUNT ( 'Date'[Date] ),
FILTER (
VALUES ( 'Date'[Date] ),
'Date'[Date] <= TODAY ()
&& WEEKDAY ( 'Date'[Date] ) IN { 2, 3, 4, 5, 6 }
)
)

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Announcements