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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
lawada
Helper III
Helper III

fiscal week calculations

hello, 

 

i need help in this, 

 

i have a fiscal week calender which starts on wednesday and ends on tuesday so week day =1 on wednesday and weekday= 7 on tuesday. 

 

in my reprot user will select from two slicers :

1- montn (EX. December)

2- Week number (EX. Week2)

 

in this case ,the date will be between (2-12-2020 and 8-12-2020)

 

now the output that i have to calculate is :

 

(total orders for the same selected period LAST MONTH ) which according to the given example output should be within:

 Month :November- Week: Week 2 - date between: (11-11-2020 and 17-11-2020)

 

note that the given dates are just an example to explain how the logic should work so i would like my DAX measure to calulate dynamically the output for any selected Month and week the user will select.

 

 

Appreciate the help..

 

1 REPLY 1
amitchandak
Super User
Super User

@lawada , for Tuesday week, refer

 

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

 

for  month week

 

Start Month = STARTOMONTH('Date'[Date])
WeekDay = WEEKDAY([Date],2) //Use the Tuesday week this is Monday
Start of Week = [Date] -[WeekDay]+1 //Use the Tuesday week this is Monday
Month Week = QUOTIENT(DATEDIFF(Minx(FILTER('Date',[Start Month]=EARLIER([Start Month])),'Date'[Start of Week]),[Date],DAY),7)+1

 

now you can compare week this month vs week last month

 

Otherwise week is 28 days behind

last month same week Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-28,DAY )))

 

 

also check

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.