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
JST15
Frequent Visitor

Calculate YTD Sales Based on a 4 4 5 Calendar and Excludes Current Period

Hello! My company uses a 4 4 5 calendar meaning for each quarter of the year there are two months with 4 weeks and one month with 5 weeks. For example, Q1 January and February have 4 weeks and March has 5 weeks. Further, the January 2025 period is December 29, 2024 - January 25, 2025 which is period 1. Period 2 is January 26, 2025 - Feb 22, 2025. Our reporting goes by the periods rather than calender date. I have a calendar table that already tells me the correct period based on date. For example, it populates period 2 for January 27th automatically.  I'm trying to create columns in this table that flag the periods as either MTD, YTD or TTM based on the periods, but also exclude current period. 

 

At this point I'm at a loss. At the below link is a file named 445 Calendar.pbix. I'm using the last two columns show my work for TTM_Flag and YTD_Flag. I'll know it's working when I filter TTM_Flag and only the months Feb24 - Jan 25 have the TTM for example. 

 

Can someone help me figure out how to make this work? I appreciate everyones time and help!!

 

https://github.com/jt8215/Calendar.git 

1 REPLY 1
lbendlin
Super User
Super User

Current Fiscal Period = CALCULATE(FORMAT(DATE(max(DIM_CALENDAR[PERIOD_YEAR]),max(DIM_CALENDAR[PERIOD_MONTH]),1),"YYYYMM"),DIM_CALENDAR[CALENDAR_DATE]=TODAY())

 

YTD_Flag = 
VAR TodayDate = TODAY()
Return IF(year([CALENDAR_DATE])=year(TodayDate) && [CALENDAR_DATE]<=TodayDate,"YTD")

 

Not familiar with "TTM" - what is that?

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! Prices go up Feb. 11th.

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.

Jan NL Carousel

Fabric Community Update - January 2025

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