Forum Discussion

Mederic's avatar
Mederic
Post Patron
11 months ago
Solved

Custom calendar

Hello everyone, I would like to customise a calendar that has a certain number of columns. I am unable to adapt the M code for the two columns ‘Weeks Nr.’ and ‘Range Days’. The ultimate goal is to...
  • p45cal's avatar
    11 months ago

    How about this as a pivot table presentation:

    I stayed with Wednesday being the start of a week so that my results match your results.

    Change your end date in cell 'end' to one within the first 2 or 3 weeks of the year to see what happens when you refresh the pivot at cell V13.

    See the calendar query in the attached which outputs directly to the pivot.

    Hope it gives you some ideas.

     

    Edit: Note, that if you want the week to begin on a Monday, there are 2 places where you need to change that:

    1. The first step called FirstDateOfWeekNos where you change Day.Wednesday to Day.Monday (or just delete Day.Wednesday and its preceding comma since Monday is the default if you don't supply that argument), and

    2. The step called Inserted Start of Week where you do the same.