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
Anonymous
Not applicable

MTD but the week starting from friday

Hi there guys, 

I have a simple date column in my dataset and I need to calculate sum of the revenue as MTD, but the week in our terms start on Friday and ends on Thursday.Thus, if today is 25th of Jan, then MTD would only calculate until 21th of Jan included. Any ideas how can I do that? 

3 REPLIES 3
Anonymous
Not applicable

I cant figure it out for the previous month, @amitchandak  have you got any ideas?

amitchandak
Super User
Super User

@Anonymous , Please create a Friday Thrusday week using my blog and then have formula like

 

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

 

MTD QTY forced=
var _max = maxx(allselected(Date), Date[week Start date])
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESMTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALMTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))

Anonymous
Not applicable

@amitchandak  Dude, thank you so much,  that works. Now I need to add one more column but for the same period last month, how should I adjust the formula? Its literally the same calculation, just for the previous month. 

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.