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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Haydn_R
Helper I
Helper I

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

@Haydn_R , 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-Powe...
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e...

 


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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Haydn_R , 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-Powe...
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e...

 


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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