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
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
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