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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Squalleh
Frequent Visitor

How to count the number of each day of week within a certain date range without a DateTable?

Hi !

I have a new problem, my boss wants me to count the number of monday/... during the last 30days... I've try a lot of things but I'm still in trouble with that because I've find solutions with a DateTable and I can't use that...

Is there anyone with an idea?

 

Thx 🙂

Sq'

1 ACCEPTED SOLUTION
vanessafvg
Super User
Super User

@Squalleh  why can't you use a date table?  that would be the easier to to do

 

it would be a simple measure

 

https://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/

 

 

no of mondays in last 30 days  =

CALCULATE (
COUNTROWS ( date ),
FILTER (
date,
DATESBETWEEN ( date[date], DATEADD ( date[date], -30, DAY ), date[date] )
&& dayofweek = "monday"
)
)





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
vanessafvg
Super User
Super User

@Squalleh  why can't you use a date table?  that would be the easier to to do

 

it would be a simple measure

 

https://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/

 

 

no of mondays in last 30 days  =

CALCULATE (
COUNTROWS ( date ),
FILTER (
date,
DATESBETWEEN ( date[date], DATEADD ( date[date], -30, DAY ), date[date] )
&& dayofweek = "monday"
)
)





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvgthank you for your answer!

Finaly my boss accept to let me add a date table... so.... Problem solved!

 

Have a nice day!

Sq'

Hi,

 

Could you share how did you solved?

 

Thanks.

 

Mauricio

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors