Date Table, change the start weekday to Saturday

I have checked the updated Code of date table which is on Enterprise DNA , Sam mentioned it in a tutorial , what i need is in my country Egypt we start the week in Saturday and i couldn’t modify the code as it only started in Monday,
I need your Help about that,
Thanks

le

Check out this thread on Tools and Techniques for Providing PBIX Files with Your Forum Questions

Also make sure that your data file contains no confidential information. If it does, click the link above.

*** DELETE THIS MESSAGE IF YOU ARE SURE ALL YOUR DETAILS ARE COMPLETE OR IF THE ABOVE INFORMATION IS NOT APPLICABLE TO YOUR QUESTION.***

Hi @Abeer,

The Extended Date Table (Power Query M function) is an ISO-8601 calendar (weeks start on Monday).
Try the Basic Date Table (Power Query M function) instead.

I hope this is helpful.

2 Likes

Hi Melissa,
thanks for your reply,
can you pls. give the this [Basic Date Table (Power Query M function) ].
thanks

Hi @Abeer,

Clicking on the link provided above will bring you to the topic where you can find the code, just scroll and copy the M code into a new blank query as illustrated in many webinars and videos.

Hope this helps

Thanks, Mellisa,
ok i copied the code to a blank query and i got a date table
but Saturday came with No. 0
shouldn’t be No. 1 as it is the first day of the week??

Please take some time to read the linked post, you’ll discover that by default (because Power Query is zero based) the first day is set to 0 but you can change that using the WDStartNum (optional parameter of type number, change weekday number from 0…6 to 1…7)

1 Like

Hi Melissa,
I have tried to make the optional parameter as you advised , but didn’t work,
then i had to change the (M Code) It self and then i chose the optional parameter,
and finally worked ,
Thanks a lot.

Hi @Abeer,

You shouldn’t have to modify anything in de M code when passing the optional WDStartNum as you can see below the code works as expected. First day of the week is Saturday and that gets assigned a 1.

1 Like

I have checked the updated Code of date table which is on Enterprise DNA , Sam mentioned it in a tutorial , what i need is in my country Egypt we start the week in Saturday and i couldn’t modify the code as it only started in Monday,
I need your Help about that,
Thanks

@Abeer , hi!

In case you would work with Date Table in Power Query:
use the function " Date.WeekOfYear" with syntaxis:

Date.WeekOfYear([DateColumn],Day.Saturday)

In case you would work with DAX:
use WEEKNUM function with syntaxis:

WeekNum = WEEKNUM(‘Date Table’[Date Column],16)

Hope, it helps!

BR,
Oleg

@Abeer. Unsure why you asked the same question again … @Melissa just solved your question with the same title yesterday. Please see earlier answer.
Greg

I saw the answer that @Melissa replied to and it worked fine for me to Start weekday on Saturday…I guess he didn’t read it properly
keith

Since this is a duplicate question @Abeer , I’m linking the thread that solved your question here.

Kindly refer to the solution below: