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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

How to set start date to be first Sunday of the year?

Currently it works fine because 1st Jan 23 is a Sunday, however next year it will be Monday. How do i make sure that start date within my CALENDAR() function always falls on a Monday e.g. 7 Jan 24 (Sunday)?

1 ACCEPTED SOLUTION
hendraoui
Regular Visitor

Hello,

 

You can create a new calculated column in the table containing the date column that you want to modify. You can do this by right-clicking on the table and selecting "New column".

Start Date =
DATE(YEAR([Date]), 1, 1) + MOD(8 - WEEKDAY(DATE(YEAR([Date]), 1, 1)), 7)

 

View solution in original post

3 REPLIES 3
hendraoui
Regular Visitor

Hello,

 

You can create a new calculated column in the table containing the date column that you want to modify. You can do this by right-clicking on the table and selecting "New column".

Start Date =
DATE(YEAR([Date]), 1, 1) + MOD(8 - WEEKDAY(DATE(YEAR([Date]), 1, 1)), 7)

 

Ahmedx
Super User
Super User

To be honest, I don't understand what you want.
show me what you want

Anonymous
Not applicable

some_date_table = CALENDAR(<start date is first sunday of January every year>, <last sunday of the year; i suppose I could add 364 days>)

 

How would I go on about doing the first argument?

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors