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

Need help to Calculate Current Year Week to Date (CY WTD) and Prior Year Week to date (PY WTD)

@Greg_Deckler @tamerj1 @Ahmedx 

 

Hello All,

 

I need help to Calculate Current Year Week to Date (CY WTD) and Prior Year Week to date (PY WTD) in pbi. Please see screenshot below:

 

Abhishek98_0-1679429547297.png

 

Our current Fiscal Year started on July 3, 2022 and runs through July 1, 2023. Our prior Fiscal Year started on July 4, 2021 and ran through July 2, 2022. You can just show me how to calculate the first two columns in the screenshot and I am pretty sure I can tweak the expression a little bit to create the other columns. Any help is much appreciated!!!

 

Thank you all,

 

3 REPLIES 3
Anonymous
Not applicable

@Greg_Deckler  I was wondering if you were able to look into this?👆

Greg_Deckler
Super User
Super User

@Anonymous Any chance you can share your custom fiscal calendar? Will make things way easier. Sample fact data along with it even better. Either paste it as text in a table or share the files on OneDrive, Box, etc. Or if you have a formula for your custom fiscal calendar (Power Query or DAX) you can share that. In general though, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler I have added the fiscal calender to a google sheet and link is: https://docs.google.com/spreadsheets/d/1pjjp65zRGJjW-wWYNYFysY_tI6ZHk3putzmzCCcEk6Q/edit?pli=1#gid=1... 

 

For the Sample fact data, I am unclear on what you mean by that as I do not have any sample data but I do have have Invoice Cases, Sales$$ and Margin as pbi datasets in pbi desktop if that helps. So for example, we may have to filter the Cases/sales/Margin by the "CY WTD" or "PY WTD" time prompt to pull the data. I have included a screenshot of the table names and the datasets that fall within them to help you with the DAX expression:

 

Abhishek98_0-1679491054860.png

 

Abhishek98_2-1679491116153.png

 

 

Abhishek98_3-1679491162322.png

 

 

Abhishek98_4-1679491183245.png

 

I hope this helps, please let me know if you need anything else from my end.

 

Thanks Greg,

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.