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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
cottrera
Post Prodigy
Post Prodigy

Countrows for dates that match week start date

Hi

 

I have a facts table which is a daily snapshot of lots of rows of data. I also have my dates table (both shown below)

I am struggling to countrows of the facts table if the date added match the start of the week.

I am not interested if all the other dates fall into that week only if the date added match the start of the week.

The result I would expect from the data below would = 4 (4 x 02/11/2020)

 

Facts Table 
Date AddedTrade
02/11/2020X
02/11/2020X
02/11/2020X
02/11/2020X
03/11/2020X
03/11/2020X
04/11/2020X
04/11/2020X
04/11/2020X
04/11/2020X
04/11/2020X
05/11/2020X
05/11/2020X
05/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X
06/11/2020X

 

Dates Table  
Dim DateWeekstart dateWeekstart number
02/11/202002/11/20200
03/11/202002/11/20201
04/11/202002/11/20202
05/11/202002/11/20204
06/11/202002/11/20205
07/11/202002/11/20206
08/11/202002/11/20200

thank you

Richard

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@cottrera , not very clear. You can get start of week like

Sunday start

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],1)+1

Monday start

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

 

Others refer: https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

You can compare that with date you got and create a flag

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
cottrera
Post Prodigy
Post Prodigy

amitchandak
Super User
Super User

@cottrera , not very clear. You can get start of week like

Sunday start

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],1)+1

Monday start

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

 

Others refer: https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

You can compare that with date you got and create a flag

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.