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
elois33
Helper I
Helper I

Change the starting date of a year

Hello, 

 

I have the following DAX for an automated calendar: 

 

Calendar=
ADDCOLUMNS(
CALENDARAUTO(),
"year", YEAR([Date]),
"month",FORMAT([Date],"MMMM"),
"month year", FORMAT([Date],"MMMM YYYY"),
"day of week",FORMAT([Date],"dddd"),
"day", DAY([Date])
)
 
I want to change the starting date of my calendar-year in a way that each year will not start in the 1 january but earlier in december (like 11 or 15). I there anything that I can do?  Thank you! 
3 REPLIES 3
v-jialluo-msft
Community Support
Community Support

Hi  @elois33 ,

 

You can try this:

CALENDAR = ADDCOLUMNS(

CALENDAR(date(2022,1,1),date(2022,12,31)),

"YEAR",YEAR([Date]),

"QUARTER",ROUNDUP(MONTH([Date])/3,0),

"MONTH",MONTH([Date]),

"WEEKNUM",WEEKNUM([Date]),

"YEAR-QUARTER",YEAR([Date]) & "Q" & ROUNDUP(MONTH([Date])/3,0),

"YEAR-MONTH",YEAR([Date])*100+MONTH([Date]),

"YEAR-WEEK",YEAR([Date])*100+WEEKNUM([Date]),

"WEEKDAY",WEEKDAY([Date])

)

 

Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

elois33
Helper I
Helper I

Thank you @amitchandak for this helpful post! Indeed very interesting! I was looking if there is a way to make it easier to modify because we chang the starting date every year. So I was hoping finding something with DATESBETWEEN where my colleuges can have easily access and modify if any need. For example IF(DATESBETWEEN(Calendar[year],11/12/2022,11/12/2023), "S2023"

IF(DATESBETWEEN(Calendar[year],12/12/2023,13/12/2024), "S2024"

 

Thank you!

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.