How to count the number of Mondays in a date range

amulder

New Member
Joined
Oct 28, 2016
Messages
20
I've been searching and searching but I can't seem to find the syntax for a measure that will allow me to count the number of Mondays within a date range. The date range will be selected through a slicer on the same page.

What is the DAX syntax in order to do this?

Thanks!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
You could add a Calculated Column displaying the weekday
Code:
= WEEKDAY( Dates[Date] )
and then your measure
Code:
= CALCULATE( COUNTROWS( Dates ), Dates[WeekDay] = 2 )
 
Upvote 0
[FONT=&quot]I need the day of the week to adjust automatically when I add it to my matrix but only be filtered by the column not the row. Right now I'm just using a simple COUNT('Date'[DOW) which works on its own, however in my matrix I have a column titled HourBlock that breaks my count of records (Number) down by hour. Since not every hour within the month filter has records the DOW_COUNT gets filtered accordingly. I don't want it to. I essentially want the values that I see in the small matrix beside the big one which has the official counts of the days of the week.[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]
large
[/FONT]
 
Upvote 0
Are you looking to remove the filter being applied by the HourBlock Column? Have you tried using ALL to remove the filter from within CALCULATE ?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top