You need to create a table (master calendar) where you will have all the dates between the 1st and the last one of your data. For each date, you can compute many informations like the week day, the month, the Year, the YTD (or not) etc. Everything that will be useful in the UI