Extended Date Table

Hi,

With regards to the fantastic Extended Date Table created by Melissa, I’ve had a search through the forum, perhaps I’ve not understood the posts that were relevant but I’d like to change the week start day to start on a Sunday.

How do I amend the M code to achieve this.

Thanks

David

@DavieJoe Table.AddColumn(Table, “Start of Week”, each Date.StartOfWeek([Date], Day.Sunday), type date)

1 Like

Sorry, I can’t seem to find that.

@DavieJoe ,

@Melissa 's already got you covered. You’ve probably just skipped over this a million times without noticing it, but that option is right on the front parameters screen:

  • Brian

Man…I need to get my glasses checked :eyeglasses:

Hi @DavieJoe,

@AntrikshSharma already answered your question but just a small reminder that the Extended Date table is an ISO-8601 type calendar so weeks always start on a monday.

You can try out the Basic date table here, which does allow you to set a StartOfWeekDay parameter of type number, where 0=Sunday … 6=Saterday

The parameter that @BrianJ highlighted only allows you to switch the weekday numbering from 0…6 (default) to 1…7

2 Likes

@DavieJoe ,

Happens to me all the time. You just jump right to the stuff you need and look past the stuff you don’t. I’m actually going to be starting a YouTube series soon called Power BI Buried Treasures, about cool switches and options buried within the program that almost all of us overlook.

  • Brian
1 Like

Thanks Melissa, I hadn’t fully understood the implications of the ISO-8601 calendar…ironically…the Monday to Sunday works fine for every single report & business area…but hey-ho…I’ve discovered a reporting date requirement that is different to every other single one in the business, typical :slight_smile:

Thank you for the Basic Date Table link, ideal :slight_smile:

If it’s a blog can you do it in 40 point font please :joy:

2 Likes

Hello,

Where specifically in the enhanced date table code is this line placed to get the requisite effect?

Thank you,

Marco

Hi @marco.a.delfino75

Please note is not recommended to post to any posting that is closed. Please start a new posting where posssible.

the code is on @Melissa forum post
Here is the link
Extended Date Table (Power Query M function) - Power Query / M Code Showcase - Enterprise DNA Forum

I hope this helps.

thanks
Keith

1 Like