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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Return a count of ID by last Week Ending Date

I'm currently using the following to return the weekending (Friday) for a column called "Request Date"

Week End Date Internal = format('Internal Requests'[Request Date] - WEEKDAY('Internal Requests'[Request Date],2)+5,"DD Mmmm YYYY")


 What I'd now like to do is do a count of the measure called "ID", that will give the the count of "ID" for the latest Week Ending.

 

Desire result below. 

 

Week End Date    ID
02-Dec-22           350


Table below mock up of data in a table. I have been suing PB for a couple of weeks, so any help is appreciated.

 

Week End     Date ID
18- Nov-22   987
25-Nov-22   500
02-Dec-22    350

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , week start sat, week end friday

 

Week Start date(Sat-Fri) = 'Date'[Date]+-1*if(WEEKDAY('Date'[Date])<7,WEEKDAY('Date'[Date]),WEEKDAY('Date'[Date])-7)Week End date(Sat-Fri) = 'Date'[Date]+-1*if(WEEKDAY('Date'[Date])<7,WEEKDAY('Date'[Date]),WEEKDAY('Date'[Date])-7) +6

 

 

in measure use max(Date[Date]) of maxx(allselected(date), Date[Date]) ot today

 

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e6f593958

 


Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , week start sat, week end friday

 

Week Start date(Sat-Fri) = 'Date'[Date]+-1*if(WEEKDAY('Date'[Date])<7,WEEKDAY('Date'[Date]),WEEKDAY('Date'[Date])-7)Week End date(Sat-Fri) = 'Date'[Date]+-1*if(WEEKDAY('Date'[Date])<7,WEEKDAY('Date'[Date]),WEEKDAY('Date'[Date])-7) +6

 

 

in measure use max(Date[Date]) of maxx(allselected(date), Date[Date]) ot today

 

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e6f593958

 


Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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.

Top Solution Authors